mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into moduleResolutionStrategies
Conflicts: src/compiler/diagnosticMessages.json
This commit is contained in:
+3
-3
@@ -158,10 +158,10 @@ var harnessSources = harnessCoreSources.concat([
|
||||
|
||||
var librarySourceMap = [
|
||||
{ target: "lib.core.d.ts", sources: ["core.d.ts"] },
|
||||
{ target: "lib.dom.d.ts", sources: ["importcore.d.ts", "extensions.d.ts", "intl.d.ts", "dom.generated.d.ts"], },
|
||||
{ target: "lib.webworker.d.ts", sources: ["importcore.d.ts", "extensions.d.ts", "intl.d.ts", "webworker.generated.d.ts"], },
|
||||
{ target: "lib.dom.d.ts", sources: ["importcore.d.ts", "intl.d.ts", "dom.generated.d.ts"], },
|
||||
{ target: "lib.webworker.d.ts", sources: ["importcore.d.ts", "intl.d.ts", "webworker.generated.d.ts"], },
|
||||
{ target: "lib.scriptHost.d.ts", sources: ["importcore.d.ts", "scriptHost.d.ts"], },
|
||||
{ target: "lib.d.ts", sources: ["core.d.ts", "extensions.d.ts", "intl.d.ts", "dom.generated.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"], },
|
||||
{ target: "lib.d.ts", sources: ["core.d.ts", "intl.d.ts", "dom.generated.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"], },
|
||||
{ target: "lib.core.es6.d.ts", sources: ["core.d.ts", "es6.d.ts"]},
|
||||
{ target: "lib.es6.d.ts", sources: ["core.d.ts", "es6.d.ts", "intl.d.ts", "dom.generated.d.ts", "dom.es6.d.ts", "webworker.importscripts.d.ts", "scriptHost.d.ts"] },
|
||||
];
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
[](https://gitter.im/Microsoft/TypeScript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
[TypeScript](http://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types, classes, and modules to JavaScript. TypeScript supports tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](http://www.typescriptlang.org/Playground), and stay up to date via [our blog](http://blogs.msdn.com/typescript) and [twitter account](https://twitter.com/typescriptlang).
|
||||
[TypeScript](http://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types, classes, and modules to JavaScript. TypeScript supports tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](http://www.typescriptlang.org/Playground), and stay up to date via [our blog](http://blogs.msdn.com/typescript) and [Twitter account](https://twitter.com/typescriptlang).
|
||||
|
||||
## Installing
|
||||
|
||||
|
||||
Vendored
+2653
-12
File diff suppressed because it is too large
Load Diff
Vendored
+2800
-2548
File diff suppressed because it is too large
Load Diff
Vendored
+411
-64
@@ -331,31 +331,31 @@ interface String {
|
||||
|
||||
/**
|
||||
* Replaces text in a string, using a regular expression or search string.
|
||||
* @param searchValue A String object or string literal that represents the regular expression
|
||||
* @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj.
|
||||
* @param searchValue A string that represents the regular expression.
|
||||
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
|
||||
*/
|
||||
replace(searchValue: string, replaceValue: string): string;
|
||||
|
||||
/**
|
||||
* Replaces text in a string, using a regular expression or search string.
|
||||
* @param searchValue A String object or string literal that represents the regular expression
|
||||
* @param replaceValue A function that returns the replacement text.
|
||||
* @param searchValue A string that represents the regular expression.
|
||||
* @param replacer A function that returns the replacement text.
|
||||
*/
|
||||
replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string;
|
||||
replace(searchValue: string, replacer: (substring: string, ...args: any[]) => string): string;
|
||||
|
||||
/**
|
||||
* Replaces text in a string, using a regular expression or search string.
|
||||
* @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags
|
||||
* @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj.
|
||||
* @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags.
|
||||
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
|
||||
*/
|
||||
replace(searchValue: RegExp, replaceValue: string): string;
|
||||
|
||||
/**
|
||||
* Replaces text in a string, using a regular expression or search string.
|
||||
* @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags
|
||||
* @param replaceValue A function that returns the replacement text.
|
||||
* @param replacer A function that returns the replacement text.
|
||||
*/
|
||||
replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string;
|
||||
replace(searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string;
|
||||
|
||||
/**
|
||||
* Finds the first substring match in a regular expression search.
|
||||
@@ -986,14 +986,14 @@ interface JSON {
|
||||
* @param replacer A function that transforms the results.
|
||||
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
||||
*/
|
||||
stringify(value: any, replacer: (key: string, value: any) => any, space: any): string;
|
||||
stringify(value: any, replacer: (key: string, value: any) => any, space: string | number): string;
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
* @param replacer Array that transforms the results.
|
||||
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
||||
*/
|
||||
stringify(value: any, replacer: any[], space: any): string;
|
||||
stringify(value: any, replacer: any[], space: string | number): string;
|
||||
}
|
||||
/**
|
||||
* An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.
|
||||
@@ -1196,11 +1196,13 @@ interface PromiseLike<T> {
|
||||
*/
|
||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>;
|
||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>;
|
||||
}
|
||||
}
|
||||
|
||||
interface ArrayLike<T> {
|
||||
length: number;
|
||||
[n: number]: T;
|
||||
}
|
||||
|
||||
/////////////////////////////
|
||||
/// IE10 ECMAScript Extensions
|
||||
/////////////////////////////
|
||||
|
||||
/**
|
||||
* Represents a raw buffer of binary data, which is used to store data for the
|
||||
@@ -1253,14 +1255,14 @@ interface DataView {
|
||||
* 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;
|
||||
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;
|
||||
getFloat64(byteOffset: number, littleEndian?: boolean): number;
|
||||
|
||||
/**
|
||||
* Gets the Int8 value at the specified byte offset from the start of the view. There is
|
||||
@@ -1274,13 +1276,13 @@ interface DataView {
|
||||
* 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;
|
||||
getInt16(byteOffset: number, littleEndian?: boolean): number;
|
||||
/**
|
||||
* Gets the Int32 value at the specified byte offset from the start of the view. There is
|
||||
* no alignment constraint; multi-byte values may be fetched from any offset.
|
||||
* @param byteOffset The place in the buffer at which the value should be retrieved.
|
||||
*/
|
||||
getInt32(byteOffset: number, littleEndian: boolean): number;
|
||||
getInt32(byteOffset: number, littleEndian?: boolean): number;
|
||||
|
||||
/**
|
||||
* Gets the Uint8 value at the specified byte offset from the start of the view. There is
|
||||
@@ -1294,14 +1296,14 @@ interface DataView {
|
||||
* 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;
|
||||
getUint16(byteOffset: number, littleEndian?: boolean): number;
|
||||
|
||||
/**
|
||||
* Gets the Uint32 value at the specified byte offset from the start of the view. There is
|
||||
* no alignment constraint; multi-byte values may be fetched from any offset.
|
||||
* @param byteOffset The place in the buffer at which the value should be retrieved.
|
||||
*/
|
||||
getUint32(byteOffset: number, littleEndian: boolean): number;
|
||||
getUint32(byteOffset: number, littleEndian?: boolean): number;
|
||||
|
||||
/**
|
||||
* Stores an Float32 value at the specified byte offset from the start of the view.
|
||||
@@ -1310,7 +1312,7 @@ interface DataView {
|
||||
* @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;
|
||||
setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;
|
||||
|
||||
/**
|
||||
* Stores an Float64 value at the specified byte offset from the start of the view.
|
||||
@@ -1319,7 +1321,7 @@ interface DataView {
|
||||
* @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;
|
||||
setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;
|
||||
|
||||
/**
|
||||
* Stores an Int8 value at the specified byte offset from the start of the view.
|
||||
@@ -1335,7 +1337,7 @@ interface DataView {
|
||||
* @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;
|
||||
setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;
|
||||
|
||||
/**
|
||||
* Stores an Int32 value at the specified byte offset from the start of the view.
|
||||
@@ -1344,7 +1346,7 @@ interface DataView {
|
||||
* @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;
|
||||
setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;
|
||||
|
||||
/**
|
||||
* Stores an Uint8 value at the specified byte offset from the start of the view.
|
||||
@@ -1360,7 +1362,7 @@ interface DataView {
|
||||
* @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;
|
||||
setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;
|
||||
|
||||
/**
|
||||
* Stores an Uint32 value at the specified byte offset from the start of the view.
|
||||
@@ -1369,7 +1371,7 @@ interface DataView {
|
||||
* @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;
|
||||
setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
|
||||
}
|
||||
|
||||
interface DataViewConstructor {
|
||||
@@ -1576,7 +1578,7 @@ interface Int8Array {
|
||||
* @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.
|
||||
*/
|
||||
set(array: Int8Array, offset?: number): void;
|
||||
set(array: ArrayLike<number>, offset?: number): void;
|
||||
|
||||
/**
|
||||
* Returns a section of an array.
|
||||
@@ -1625,8 +1627,7 @@ interface Int8Array {
|
||||
interface Int8ArrayConstructor {
|
||||
prototype: Int8Array;
|
||||
new (length: number): Int8Array;
|
||||
new (array: Int8Array): Int8Array;
|
||||
new (array: number[]): Int8Array;
|
||||
new (array: ArrayLike<number>): Int8Array;
|
||||
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array;
|
||||
|
||||
/**
|
||||
@@ -1639,6 +1640,15 @@ interface Int8ArrayConstructor {
|
||||
* @param items A set of elements to include in the new array object.
|
||||
*/
|
||||
of(...items: number[]): Int8Array;
|
||||
|
||||
/**
|
||||
* Creates an array from an array-like or iterable object.
|
||||
* @param arrayLike An array-like or iterable object to convert to an array.
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array;
|
||||
|
||||
}
|
||||
declare var Int8Array: Int8ArrayConstructor;
|
||||
|
||||
@@ -1841,7 +1851,7 @@ interface Uint8Array {
|
||||
* @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.
|
||||
*/
|
||||
set(array: Uint8Array, offset?: number): void;
|
||||
set(array: ArrayLike<number>, offset?: number): void;
|
||||
|
||||
/**
|
||||
* Returns a section of an array.
|
||||
@@ -1891,8 +1901,7 @@ interface Uint8Array {
|
||||
interface Uint8ArrayConstructor {
|
||||
prototype: Uint8Array;
|
||||
new (length: number): Uint8Array;
|
||||
new (array: Uint8Array): Uint8Array;
|
||||
new (array: number[]): Uint8Array;
|
||||
new (array: ArrayLike<number>): Uint8Array;
|
||||
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array;
|
||||
|
||||
/**
|
||||
@@ -1905,9 +1914,291 @@ interface Uint8ArrayConstructor {
|
||||
* @param items A set of elements to include in the new array object.
|
||||
*/
|
||||
of(...items: number[]): Uint8Array;
|
||||
|
||||
/**
|
||||
* Creates an array from an array-like or iterable object.
|
||||
* @param arrayLike An array-like or iterable object to convert to an array.
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array;
|
||||
|
||||
}
|
||||
declare var Uint8Array: Uint8ArrayConstructor;
|
||||
|
||||
/**
|
||||
* A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.
|
||||
* If the requested number of bytes could not be allocated an exception is raised.
|
||||
*/
|
||||
interface Uint8ClampedArray {
|
||||
/**
|
||||
* 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): Uint8ClampedArray;
|
||||
|
||||
/**
|
||||
* 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: Uint8ClampedArray) => 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): Uint8ClampedArray;
|
||||
|
||||
/**
|
||||
* 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: Uint8ClampedArray) => boolean, thisArg?: any): Uint8ClampedArray;
|
||||
|
||||
/**
|
||||
* 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<number>) => 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: Uint8ClampedArray) => 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;
|
||||
|
||||
/**
|
||||
* 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: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;
|
||||
|
||||
/**
|
||||
* 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: Uint8ClampedArray) => 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<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => 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: Uint8ClampedArray) => 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<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
|
||||
|
||||
/**
|
||||
* Reverses the elements in an Array.
|
||||
*/
|
||||
reverse(): Uint8ClampedArray;
|
||||
|
||||
/**
|
||||
* Sets a value or an array of values.
|
||||
* @param index The index of the location to set.
|
||||
* @param value The value to set.
|
||||
*/
|
||||
set(index: number, value: 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.
|
||||
*/
|
||||
set(array: Uint8ClampedArray, offset?: number): void;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
slice(start?: number, end?: number): Uint8ClampedArray;
|
||||
|
||||
/**
|
||||
* 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: Uint8ClampedArray) => 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): Uint8ClampedArray;
|
||||
|
||||
/**
|
||||
* Gets a new Uint8ClampedArray 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): Uint8ClampedArray;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
interface Uint8ClampedArrayConstructor {
|
||||
prototype: Uint8ClampedArray;
|
||||
new (length: number): Uint8ClampedArray;
|
||||
new (array: ArrayLike<number>): Uint8ClampedArray;
|
||||
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray;
|
||||
|
||||
/**
|
||||
* 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[]): Uint8ClampedArray;
|
||||
|
||||
/**
|
||||
* Creates an array from an array-like or iterable object.
|
||||
* @param arrayLike An array-like or iterable object to convert to an array.
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray;
|
||||
}
|
||||
declare var Uint8ClampedArray: Uint8ClampedArrayConstructor;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@@ -2107,7 +2398,7 @@ interface Int16Array {
|
||||
* @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.
|
||||
*/
|
||||
set(array: Int16Array, offset?: number): void;
|
||||
set(array: ArrayLike<number>, offset?: number): void;
|
||||
|
||||
/**
|
||||
* Returns a section of an array.
|
||||
@@ -2157,8 +2448,7 @@ interface Int16Array {
|
||||
interface Int16ArrayConstructor {
|
||||
prototype: Int16Array;
|
||||
new (length: number): Int16Array;
|
||||
new (array: Int16Array): Int16Array;
|
||||
new (array: number[]): Int16Array;
|
||||
new (array: ArrayLike<number>): Int16Array;
|
||||
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array;
|
||||
|
||||
/**
|
||||
@@ -2171,6 +2461,15 @@ interface Int16ArrayConstructor {
|
||||
* @param items A set of elements to include in the new array object.
|
||||
*/
|
||||
of(...items: number[]): Int16Array;
|
||||
|
||||
/**
|
||||
* Creates an array from an array-like or iterable object.
|
||||
* @param arrayLike An array-like or iterable object to convert to an array.
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array;
|
||||
|
||||
}
|
||||
declare var Int16Array: Int16ArrayConstructor;
|
||||
|
||||
@@ -2373,7 +2672,7 @@ interface Uint16Array {
|
||||
* @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.
|
||||
*/
|
||||
set(array: Uint16Array, offset?: number): void;
|
||||
set(array: ArrayLike<number>, offset?: number): void;
|
||||
|
||||
/**
|
||||
* Returns a section of an array.
|
||||
@@ -2423,8 +2722,7 @@ interface Uint16Array {
|
||||
interface Uint16ArrayConstructor {
|
||||
prototype: Uint16Array;
|
||||
new (length: number): Uint16Array;
|
||||
new (array: Uint16Array): Uint16Array;
|
||||
new (array: number[]): Uint16Array;
|
||||
new (array: ArrayLike<number>): Uint16Array;
|
||||
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array;
|
||||
|
||||
/**
|
||||
@@ -2437,6 +2735,15 @@ interface Uint16ArrayConstructor {
|
||||
* @param items A set of elements to include in the new array object.
|
||||
*/
|
||||
of(...items: number[]): Uint16Array;
|
||||
|
||||
/**
|
||||
* Creates an array from an array-like or iterable object.
|
||||
* @param arrayLike An array-like or iterable object to convert to an array.
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array;
|
||||
|
||||
}
|
||||
declare var Uint16Array: Uint16ArrayConstructor;
|
||||
/**
|
||||
@@ -2638,7 +2945,7 @@ interface Int32Array {
|
||||
* @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.
|
||||
*/
|
||||
set(array: Int32Array, offset?: number): void;
|
||||
set(array: ArrayLike<number>, offset?: number): void;
|
||||
|
||||
/**
|
||||
* Returns a section of an array.
|
||||
@@ -2688,8 +2995,7 @@ interface Int32Array {
|
||||
interface Int32ArrayConstructor {
|
||||
prototype: Int32Array;
|
||||
new (length: number): Int32Array;
|
||||
new (array: Int32Array): Int32Array;
|
||||
new (array: number[]): Int32Array;
|
||||
new (array: ArrayLike<number>): Int32Array;
|
||||
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array;
|
||||
|
||||
/**
|
||||
@@ -2702,6 +3008,14 @@ interface Int32ArrayConstructor {
|
||||
* @param items A set of elements to include in the new array object.
|
||||
*/
|
||||
of(...items: number[]): Int32Array;
|
||||
|
||||
/**
|
||||
* Creates an array from an array-like or iterable object.
|
||||
* @param arrayLike An array-like or iterable object to convert to an array.
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array;
|
||||
}
|
||||
declare var Int32Array: Int32ArrayConstructor;
|
||||
|
||||
@@ -2904,7 +3218,7 @@ interface Uint32Array {
|
||||
* @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.
|
||||
*/
|
||||
set(array: Uint32Array, offset?: number): void;
|
||||
set(array: ArrayLike<number>, offset?: number): void;
|
||||
|
||||
/**
|
||||
* Returns a section of an array.
|
||||
@@ -2954,8 +3268,7 @@ interface Uint32Array {
|
||||
interface Uint32ArrayConstructor {
|
||||
prototype: Uint32Array;
|
||||
new (length: number): Uint32Array;
|
||||
new (array: Uint32Array): Uint32Array;
|
||||
new (array: number[]): Uint32Array;
|
||||
new (array: ArrayLike<number>): Uint32Array;
|
||||
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array;
|
||||
|
||||
/**
|
||||
@@ -2968,6 +3281,14 @@ interface Uint32ArrayConstructor {
|
||||
* @param items A set of elements to include in the new array object.
|
||||
*/
|
||||
of(...items: number[]): Uint32Array;
|
||||
|
||||
/**
|
||||
* Creates an array from an array-like or iterable object.
|
||||
* @param arrayLike An array-like or iterable object to convert to an array.
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array;
|
||||
}
|
||||
declare var Uint32Array: Uint32ArrayConstructor;
|
||||
|
||||
@@ -3170,7 +3491,7 @@ interface Float32Array {
|
||||
* @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.
|
||||
*/
|
||||
set(array: Float32Array, offset?: number): void;
|
||||
set(array: ArrayLike<number>, offset?: number): void;
|
||||
|
||||
/**
|
||||
* Returns a section of an array.
|
||||
@@ -3220,8 +3541,7 @@ interface Float32Array {
|
||||
interface Float32ArrayConstructor {
|
||||
prototype: Float32Array;
|
||||
new (length: number): Float32Array;
|
||||
new (array: Float32Array): Float32Array;
|
||||
new (array: number[]): Float32Array;
|
||||
new (array: ArrayLike<number>): Float32Array;
|
||||
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array;
|
||||
|
||||
/**
|
||||
@@ -3234,6 +3554,15 @@ interface Float32ArrayConstructor {
|
||||
* @param items A set of elements to include in the new array object.
|
||||
*/
|
||||
of(...items: number[]): Float32Array;
|
||||
|
||||
/**
|
||||
* Creates an array from an array-like or iterable object.
|
||||
* @param arrayLike An array-like or iterable object to convert to an array.
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array;
|
||||
|
||||
}
|
||||
declare var Float32Array: Float32ArrayConstructor;
|
||||
|
||||
@@ -3436,7 +3765,7 @@ interface Float64Array {
|
||||
* @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.
|
||||
*/
|
||||
set(array: Float64Array, offset?: number): void;
|
||||
set(array: ArrayLike<number>, offset?: number): void;
|
||||
|
||||
/**
|
||||
* Returns a section of an array.
|
||||
@@ -3486,8 +3815,7 @@ interface Float64Array {
|
||||
interface Float64ArrayConstructor {
|
||||
prototype: Float64Array;
|
||||
new (length: number): Float64Array;
|
||||
new (array: Float64Array): Float64Array;
|
||||
new (array: number[]): Float64Array;
|
||||
new (array: ArrayLike<number>): Float64Array;
|
||||
new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array;
|
||||
|
||||
/**
|
||||
@@ -3500,8 +3828,17 @@ interface Float64ArrayConstructor {
|
||||
* @param items A set of elements to include in the new array object.
|
||||
*/
|
||||
of(...items: number[]): Float64Array;
|
||||
|
||||
/**
|
||||
* Creates an array from an array-like or iterable object.
|
||||
* @param arrayLike An array-like or iterable object to convert to an array.
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;
|
||||
}
|
||||
declare var Float64Array: Float64ArrayConstructor;/////////////////////////////
|
||||
declare var Float64Array: Float64ArrayConstructor;
|
||||
/////////////////////////////
|
||||
/// ECMAScript Internationalization API
|
||||
/////////////////////////////
|
||||
|
||||
@@ -6135,7 +6472,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
|
||||
* @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;
|
||||
open(url?: string, name?: string, features?: string, replace?: boolean): Document;
|
||||
/**
|
||||
* 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.
|
||||
@@ -6706,7 +7043,7 @@ interface File extends Blob {
|
||||
|
||||
declare var File: {
|
||||
prototype: File;
|
||||
new(): File;
|
||||
new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File;
|
||||
}
|
||||
|
||||
interface FileList {
|
||||
@@ -10541,7 +10878,7 @@ interface IDBDatabase extends EventTarget {
|
||||
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: "abort", 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;
|
||||
}
|
||||
@@ -10662,7 +10999,7 @@ interface IDBTransaction extends EventTarget {
|
||||
READ_ONLY: string;
|
||||
READ_WRITE: string;
|
||||
VERSION_CHANGE: string;
|
||||
addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: "abort", listener: (ev: Event) => 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;
|
||||
@@ -10692,11 +11029,14 @@ interface ImageData {
|
||||
width: number;
|
||||
}
|
||||
|
||||
declare var ImageData: {
|
||||
interface ImageDataConstructor {
|
||||
prototype: ImageData;
|
||||
new(): ImageData;
|
||||
new(width: number, height: number): ImageData;
|
||||
new(array: Uint8ClampedArray, width: number, height: number): ImageData;
|
||||
}
|
||||
|
||||
declare var ImageData: ImageDataConstructor;
|
||||
|
||||
interface KeyboardEvent extends UIEvent {
|
||||
altKey: boolean;
|
||||
char: string;
|
||||
@@ -15638,7 +15978,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
|
||||
onvolumechange: (ev: Event) => any;
|
||||
onwaiting: (ev: Event) => any;
|
||||
opener: Window;
|
||||
orientation: string;
|
||||
orientation: string | number;
|
||||
outerHeight: number;
|
||||
outerWidth: number;
|
||||
pageXOffset: number;
|
||||
@@ -15845,7 +16185,7 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget {
|
||||
LOADING: number;
|
||||
OPENED: number;
|
||||
UNSENT: number;
|
||||
addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: "abort", listener: (ev: Event) => 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;
|
||||
@@ -16115,7 +16455,7 @@ interface MSBaseReader {
|
||||
DONE: number;
|
||||
EMPTY: number;
|
||||
LOADING: number;
|
||||
addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: "abort", listener: (ev: Event) => 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;
|
||||
@@ -16271,7 +16611,7 @@ interface XMLHttpRequestEventTarget {
|
||||
onloadstart: (ev: Event) => any;
|
||||
onprogress: (ev: ProgressEvent) => any;
|
||||
ontimeout: (ev: ProgressEvent) => any;
|
||||
addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: "abort", listener: (ev: Event) => 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;
|
||||
@@ -16288,11 +16628,17 @@ interface NodeListOf<TNode extends Node> extends NodeList {
|
||||
[index: number]: TNode;
|
||||
}
|
||||
|
||||
|
||||
interface BlobPropertyBag {
|
||||
type?: string;
|
||||
endings?: string;
|
||||
}
|
||||
|
||||
interface FilePropertyBag {
|
||||
type?: string;
|
||||
lastModified?: number;
|
||||
}
|
||||
|
||||
interface EventListenerObject {
|
||||
handleEvent(evt: Event): void;
|
||||
}
|
||||
@@ -16453,7 +16799,7 @@ 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 orientation: string | number;
|
||||
declare var outerHeight: number;
|
||||
declare var outerWidth: number;
|
||||
declare var pageXOffset: number;
|
||||
@@ -16628,7 +16974,8 @@ declare function addEventListener(type: "unload", listener: (ev: Event) => any,
|
||||
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;
|
||||
declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
|
||||
/////////////////////////////
|
||||
/// WorkerGlobalScope APIs
|
||||
/////////////////////////////
|
||||
|
||||
Vendored
+21
-2316
File diff suppressed because it is too large
Load Diff
Vendored
+2824
-2560
File diff suppressed because it is too large
Load Diff
Vendored
+126
-2324
File diff suppressed because it is too large
Load Diff
+4999
-4077
File diff suppressed because it is too large
Load Diff
+6741
-5397
File diff suppressed because it is too large
Load Diff
Vendored
+343
-300
@@ -23,6 +23,7 @@ declare module "typescript" {
|
||||
contains(fileName: string): boolean;
|
||||
remove(fileName: string): void;
|
||||
forEachValue(f: (v: T) => void): void;
|
||||
clear(): void;
|
||||
}
|
||||
interface TextRange {
|
||||
pos: number;
|
||||
@@ -35,293 +36,294 @@ declare module "typescript" {
|
||||
MultiLineCommentTrivia = 3,
|
||||
NewLineTrivia = 4,
|
||||
WhitespaceTrivia = 5,
|
||||
ConflictMarkerTrivia = 6,
|
||||
NumericLiteral = 7,
|
||||
StringLiteral = 8,
|
||||
RegularExpressionLiteral = 9,
|
||||
NoSubstitutionTemplateLiteral = 10,
|
||||
TemplateHead = 11,
|
||||
TemplateMiddle = 12,
|
||||
TemplateTail = 13,
|
||||
OpenBraceToken = 14,
|
||||
CloseBraceToken = 15,
|
||||
OpenParenToken = 16,
|
||||
CloseParenToken = 17,
|
||||
OpenBracketToken = 18,
|
||||
CloseBracketToken = 19,
|
||||
DotToken = 20,
|
||||
DotDotDotToken = 21,
|
||||
SemicolonToken = 22,
|
||||
CommaToken = 23,
|
||||
LessThanToken = 24,
|
||||
LessThanSlashToken = 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 = 52,
|
||||
AtToken = 53,
|
||||
EqualsToken = 54,
|
||||
PlusEqualsToken = 55,
|
||||
MinusEqualsToken = 56,
|
||||
AsteriskEqualsToken = 57,
|
||||
SlashEqualsToken = 58,
|
||||
PercentEqualsToken = 59,
|
||||
LessThanLessThanEqualsToken = 60,
|
||||
GreaterThanGreaterThanEqualsToken = 61,
|
||||
GreaterThanGreaterThanGreaterThanEqualsToken = 62,
|
||||
AmpersandEqualsToken = 63,
|
||||
BarEqualsToken = 64,
|
||||
CaretEqualsToken = 65,
|
||||
Identifier = 66,
|
||||
BreakKeyword = 67,
|
||||
CaseKeyword = 68,
|
||||
CatchKeyword = 69,
|
||||
ClassKeyword = 70,
|
||||
ConstKeyword = 71,
|
||||
ContinueKeyword = 72,
|
||||
DebuggerKeyword = 73,
|
||||
DefaultKeyword = 74,
|
||||
DeleteKeyword = 75,
|
||||
DoKeyword = 76,
|
||||
ElseKeyword = 77,
|
||||
EnumKeyword = 78,
|
||||
ExportKeyword = 79,
|
||||
ExtendsKeyword = 80,
|
||||
FalseKeyword = 81,
|
||||
FinallyKeyword = 82,
|
||||
ForKeyword = 83,
|
||||
FunctionKeyword = 84,
|
||||
IfKeyword = 85,
|
||||
ImportKeyword = 86,
|
||||
InKeyword = 87,
|
||||
InstanceOfKeyword = 88,
|
||||
NewKeyword = 89,
|
||||
NullKeyword = 90,
|
||||
ReturnKeyword = 91,
|
||||
SuperKeyword = 92,
|
||||
SwitchKeyword = 93,
|
||||
ThisKeyword = 94,
|
||||
ThrowKeyword = 95,
|
||||
TrueKeyword = 96,
|
||||
TryKeyword = 97,
|
||||
TypeOfKeyword = 98,
|
||||
VarKeyword = 99,
|
||||
VoidKeyword = 100,
|
||||
WhileKeyword = 101,
|
||||
WithKeyword = 102,
|
||||
ImplementsKeyword = 103,
|
||||
InterfaceKeyword = 104,
|
||||
LetKeyword = 105,
|
||||
PackageKeyword = 106,
|
||||
PrivateKeyword = 107,
|
||||
ProtectedKeyword = 108,
|
||||
PublicKeyword = 109,
|
||||
StaticKeyword = 110,
|
||||
YieldKeyword = 111,
|
||||
AbstractKeyword = 112,
|
||||
AsKeyword = 113,
|
||||
AnyKeyword = 114,
|
||||
AsyncKeyword = 115,
|
||||
AwaitKeyword = 116,
|
||||
BooleanKeyword = 117,
|
||||
ConstructorKeyword = 118,
|
||||
DeclareKeyword = 119,
|
||||
GetKeyword = 120,
|
||||
IsKeyword = 121,
|
||||
ModuleKeyword = 122,
|
||||
NamespaceKeyword = 123,
|
||||
RequireKeyword = 124,
|
||||
NumberKeyword = 125,
|
||||
SetKeyword = 126,
|
||||
StringKeyword = 127,
|
||||
SymbolKeyword = 128,
|
||||
TypeKeyword = 129,
|
||||
FromKeyword = 130,
|
||||
OfKeyword = 131,
|
||||
QualifiedName = 132,
|
||||
ComputedPropertyName = 133,
|
||||
TypeParameter = 134,
|
||||
Parameter = 135,
|
||||
Decorator = 136,
|
||||
PropertySignature = 137,
|
||||
PropertyDeclaration = 138,
|
||||
MethodSignature = 139,
|
||||
MethodDeclaration = 140,
|
||||
Constructor = 141,
|
||||
GetAccessor = 142,
|
||||
SetAccessor = 143,
|
||||
CallSignature = 144,
|
||||
ConstructSignature = 145,
|
||||
IndexSignature = 146,
|
||||
TypePredicate = 147,
|
||||
TypeReference = 148,
|
||||
FunctionType = 149,
|
||||
ConstructorType = 150,
|
||||
TypeQuery = 151,
|
||||
TypeLiteral = 152,
|
||||
ArrayType = 153,
|
||||
TupleType = 154,
|
||||
UnionType = 155,
|
||||
IntersectionType = 156,
|
||||
ParenthesizedType = 157,
|
||||
ObjectBindingPattern = 158,
|
||||
ArrayBindingPattern = 159,
|
||||
BindingElement = 160,
|
||||
ArrayLiteralExpression = 161,
|
||||
ObjectLiteralExpression = 162,
|
||||
PropertyAccessExpression = 163,
|
||||
ElementAccessExpression = 164,
|
||||
CallExpression = 165,
|
||||
NewExpression = 166,
|
||||
TaggedTemplateExpression = 167,
|
||||
TypeAssertionExpression = 168,
|
||||
ParenthesizedExpression = 169,
|
||||
FunctionExpression = 170,
|
||||
ArrowFunction = 171,
|
||||
DeleteExpression = 172,
|
||||
TypeOfExpression = 173,
|
||||
VoidExpression = 174,
|
||||
AwaitExpression = 175,
|
||||
PrefixUnaryExpression = 176,
|
||||
PostfixUnaryExpression = 177,
|
||||
BinaryExpression = 178,
|
||||
ConditionalExpression = 179,
|
||||
TemplateExpression = 180,
|
||||
YieldExpression = 181,
|
||||
SpreadElementExpression = 182,
|
||||
ClassExpression = 183,
|
||||
OmittedExpression = 184,
|
||||
ExpressionWithTypeArguments = 185,
|
||||
AsExpression = 186,
|
||||
TemplateSpan = 187,
|
||||
SemicolonClassElement = 188,
|
||||
Block = 189,
|
||||
VariableStatement = 190,
|
||||
EmptyStatement = 191,
|
||||
ExpressionStatement = 192,
|
||||
IfStatement = 193,
|
||||
DoStatement = 194,
|
||||
WhileStatement = 195,
|
||||
ForStatement = 196,
|
||||
ForInStatement = 197,
|
||||
ForOfStatement = 198,
|
||||
ContinueStatement = 199,
|
||||
BreakStatement = 200,
|
||||
ReturnStatement = 201,
|
||||
WithStatement = 202,
|
||||
SwitchStatement = 203,
|
||||
LabeledStatement = 204,
|
||||
ThrowStatement = 205,
|
||||
TryStatement = 206,
|
||||
DebuggerStatement = 207,
|
||||
VariableDeclaration = 208,
|
||||
VariableDeclarationList = 209,
|
||||
FunctionDeclaration = 210,
|
||||
ClassDeclaration = 211,
|
||||
InterfaceDeclaration = 212,
|
||||
TypeAliasDeclaration = 213,
|
||||
EnumDeclaration = 214,
|
||||
ModuleDeclaration = 215,
|
||||
ModuleBlock = 216,
|
||||
CaseBlock = 217,
|
||||
ImportEqualsDeclaration = 218,
|
||||
ImportDeclaration = 219,
|
||||
ImportClause = 220,
|
||||
NamespaceImport = 221,
|
||||
NamedImports = 222,
|
||||
ImportSpecifier = 223,
|
||||
ExportAssignment = 224,
|
||||
ExportDeclaration = 225,
|
||||
NamedExports = 226,
|
||||
ExportSpecifier = 227,
|
||||
MissingDeclaration = 228,
|
||||
ExternalModuleReference = 229,
|
||||
JsxElement = 230,
|
||||
JsxSelfClosingElement = 231,
|
||||
JsxOpeningElement = 232,
|
||||
JsxText = 233,
|
||||
JsxClosingElement = 234,
|
||||
JsxAttribute = 235,
|
||||
JsxSpreadAttribute = 236,
|
||||
JsxExpression = 237,
|
||||
CaseClause = 238,
|
||||
DefaultClause = 239,
|
||||
HeritageClause = 240,
|
||||
CatchClause = 241,
|
||||
PropertyAssignment = 242,
|
||||
ShorthandPropertyAssignment = 243,
|
||||
EnumMember = 244,
|
||||
SourceFile = 245,
|
||||
JSDocTypeExpression = 246,
|
||||
JSDocAllType = 247,
|
||||
JSDocUnknownType = 248,
|
||||
JSDocArrayType = 249,
|
||||
JSDocUnionType = 250,
|
||||
JSDocTupleType = 251,
|
||||
JSDocNullableType = 252,
|
||||
JSDocNonNullableType = 253,
|
||||
JSDocRecordType = 254,
|
||||
JSDocRecordMember = 255,
|
||||
JSDocTypeReference = 256,
|
||||
JSDocOptionalType = 257,
|
||||
JSDocFunctionType = 258,
|
||||
JSDocVariadicType = 259,
|
||||
JSDocConstructorType = 260,
|
||||
JSDocThisType = 261,
|
||||
JSDocComment = 262,
|
||||
JSDocTag = 263,
|
||||
JSDocParameterTag = 264,
|
||||
JSDocReturnTag = 265,
|
||||
JSDocTypeTag = 266,
|
||||
JSDocTemplateTag = 267,
|
||||
SyntaxList = 268,
|
||||
Count = 269,
|
||||
FirstAssignment = 54,
|
||||
LastAssignment = 65,
|
||||
FirstReservedWord = 67,
|
||||
LastReservedWord = 102,
|
||||
FirstKeyword = 67,
|
||||
LastKeyword = 131,
|
||||
FirstFutureReservedWord = 103,
|
||||
LastFutureReservedWord = 111,
|
||||
FirstTypeNode = 148,
|
||||
LastTypeNode = 157,
|
||||
FirstPunctuation = 14,
|
||||
LastPunctuation = 65,
|
||||
ShebangTrivia = 6,
|
||||
ConflictMarkerTrivia = 7,
|
||||
NumericLiteral = 8,
|
||||
StringLiteral = 9,
|
||||
RegularExpressionLiteral = 10,
|
||||
NoSubstitutionTemplateLiteral = 11,
|
||||
TemplateHead = 12,
|
||||
TemplateMiddle = 13,
|
||||
TemplateTail = 14,
|
||||
OpenBraceToken = 15,
|
||||
CloseBraceToken = 16,
|
||||
OpenParenToken = 17,
|
||||
CloseParenToken = 18,
|
||||
OpenBracketToken = 19,
|
||||
CloseBracketToken = 20,
|
||||
DotToken = 21,
|
||||
DotDotDotToken = 22,
|
||||
SemicolonToken = 23,
|
||||
CommaToken = 24,
|
||||
LessThanToken = 25,
|
||||
LessThanSlashToken = 26,
|
||||
GreaterThanToken = 27,
|
||||
LessThanEqualsToken = 28,
|
||||
GreaterThanEqualsToken = 29,
|
||||
EqualsEqualsToken = 30,
|
||||
ExclamationEqualsToken = 31,
|
||||
EqualsEqualsEqualsToken = 32,
|
||||
ExclamationEqualsEqualsToken = 33,
|
||||
EqualsGreaterThanToken = 34,
|
||||
PlusToken = 35,
|
||||
MinusToken = 36,
|
||||
AsteriskToken = 37,
|
||||
SlashToken = 38,
|
||||
PercentToken = 39,
|
||||
PlusPlusToken = 40,
|
||||
MinusMinusToken = 41,
|
||||
LessThanLessThanToken = 42,
|
||||
GreaterThanGreaterThanToken = 43,
|
||||
GreaterThanGreaterThanGreaterThanToken = 44,
|
||||
AmpersandToken = 45,
|
||||
BarToken = 46,
|
||||
CaretToken = 47,
|
||||
ExclamationToken = 48,
|
||||
TildeToken = 49,
|
||||
AmpersandAmpersandToken = 50,
|
||||
BarBarToken = 51,
|
||||
QuestionToken = 52,
|
||||
ColonToken = 53,
|
||||
AtToken = 54,
|
||||
EqualsToken = 55,
|
||||
PlusEqualsToken = 56,
|
||||
MinusEqualsToken = 57,
|
||||
AsteriskEqualsToken = 58,
|
||||
SlashEqualsToken = 59,
|
||||
PercentEqualsToken = 60,
|
||||
LessThanLessThanEqualsToken = 61,
|
||||
GreaterThanGreaterThanEqualsToken = 62,
|
||||
GreaterThanGreaterThanGreaterThanEqualsToken = 63,
|
||||
AmpersandEqualsToken = 64,
|
||||
BarEqualsToken = 65,
|
||||
CaretEqualsToken = 66,
|
||||
Identifier = 67,
|
||||
BreakKeyword = 68,
|
||||
CaseKeyword = 69,
|
||||
CatchKeyword = 70,
|
||||
ClassKeyword = 71,
|
||||
ConstKeyword = 72,
|
||||
ContinueKeyword = 73,
|
||||
DebuggerKeyword = 74,
|
||||
DefaultKeyword = 75,
|
||||
DeleteKeyword = 76,
|
||||
DoKeyword = 77,
|
||||
ElseKeyword = 78,
|
||||
EnumKeyword = 79,
|
||||
ExportKeyword = 80,
|
||||
ExtendsKeyword = 81,
|
||||
FalseKeyword = 82,
|
||||
FinallyKeyword = 83,
|
||||
ForKeyword = 84,
|
||||
FunctionKeyword = 85,
|
||||
IfKeyword = 86,
|
||||
ImportKeyword = 87,
|
||||
InKeyword = 88,
|
||||
InstanceOfKeyword = 89,
|
||||
NewKeyword = 90,
|
||||
NullKeyword = 91,
|
||||
ReturnKeyword = 92,
|
||||
SuperKeyword = 93,
|
||||
SwitchKeyword = 94,
|
||||
ThisKeyword = 95,
|
||||
ThrowKeyword = 96,
|
||||
TrueKeyword = 97,
|
||||
TryKeyword = 98,
|
||||
TypeOfKeyword = 99,
|
||||
VarKeyword = 100,
|
||||
VoidKeyword = 101,
|
||||
WhileKeyword = 102,
|
||||
WithKeyword = 103,
|
||||
ImplementsKeyword = 104,
|
||||
InterfaceKeyword = 105,
|
||||
LetKeyword = 106,
|
||||
PackageKeyword = 107,
|
||||
PrivateKeyword = 108,
|
||||
ProtectedKeyword = 109,
|
||||
PublicKeyword = 110,
|
||||
StaticKeyword = 111,
|
||||
YieldKeyword = 112,
|
||||
AbstractKeyword = 113,
|
||||
AsKeyword = 114,
|
||||
AnyKeyword = 115,
|
||||
AsyncKeyword = 116,
|
||||
AwaitKeyword = 117,
|
||||
BooleanKeyword = 118,
|
||||
ConstructorKeyword = 119,
|
||||
DeclareKeyword = 120,
|
||||
GetKeyword = 121,
|
||||
IsKeyword = 122,
|
||||
ModuleKeyword = 123,
|
||||
NamespaceKeyword = 124,
|
||||
RequireKeyword = 125,
|
||||
NumberKeyword = 126,
|
||||
SetKeyword = 127,
|
||||
StringKeyword = 128,
|
||||
SymbolKeyword = 129,
|
||||
TypeKeyword = 130,
|
||||
FromKeyword = 131,
|
||||
OfKeyword = 132,
|
||||
QualifiedName = 133,
|
||||
ComputedPropertyName = 134,
|
||||
TypeParameter = 135,
|
||||
Parameter = 136,
|
||||
Decorator = 137,
|
||||
PropertySignature = 138,
|
||||
PropertyDeclaration = 139,
|
||||
MethodSignature = 140,
|
||||
MethodDeclaration = 141,
|
||||
Constructor = 142,
|
||||
GetAccessor = 143,
|
||||
SetAccessor = 144,
|
||||
CallSignature = 145,
|
||||
ConstructSignature = 146,
|
||||
IndexSignature = 147,
|
||||
TypePredicate = 148,
|
||||
TypeReference = 149,
|
||||
FunctionType = 150,
|
||||
ConstructorType = 151,
|
||||
TypeQuery = 152,
|
||||
TypeLiteral = 153,
|
||||
ArrayType = 154,
|
||||
TupleType = 155,
|
||||
UnionType = 156,
|
||||
IntersectionType = 157,
|
||||
ParenthesizedType = 158,
|
||||
ObjectBindingPattern = 159,
|
||||
ArrayBindingPattern = 160,
|
||||
BindingElement = 161,
|
||||
ArrayLiteralExpression = 162,
|
||||
ObjectLiteralExpression = 163,
|
||||
PropertyAccessExpression = 164,
|
||||
ElementAccessExpression = 165,
|
||||
CallExpression = 166,
|
||||
NewExpression = 167,
|
||||
TaggedTemplateExpression = 168,
|
||||
TypeAssertionExpression = 169,
|
||||
ParenthesizedExpression = 170,
|
||||
FunctionExpression = 171,
|
||||
ArrowFunction = 172,
|
||||
DeleteExpression = 173,
|
||||
TypeOfExpression = 174,
|
||||
VoidExpression = 175,
|
||||
AwaitExpression = 176,
|
||||
PrefixUnaryExpression = 177,
|
||||
PostfixUnaryExpression = 178,
|
||||
BinaryExpression = 179,
|
||||
ConditionalExpression = 180,
|
||||
TemplateExpression = 181,
|
||||
YieldExpression = 182,
|
||||
SpreadElementExpression = 183,
|
||||
ClassExpression = 184,
|
||||
OmittedExpression = 185,
|
||||
ExpressionWithTypeArguments = 186,
|
||||
AsExpression = 187,
|
||||
TemplateSpan = 188,
|
||||
SemicolonClassElement = 189,
|
||||
Block = 190,
|
||||
VariableStatement = 191,
|
||||
EmptyStatement = 192,
|
||||
ExpressionStatement = 193,
|
||||
IfStatement = 194,
|
||||
DoStatement = 195,
|
||||
WhileStatement = 196,
|
||||
ForStatement = 197,
|
||||
ForInStatement = 198,
|
||||
ForOfStatement = 199,
|
||||
ContinueStatement = 200,
|
||||
BreakStatement = 201,
|
||||
ReturnStatement = 202,
|
||||
WithStatement = 203,
|
||||
SwitchStatement = 204,
|
||||
LabeledStatement = 205,
|
||||
ThrowStatement = 206,
|
||||
TryStatement = 207,
|
||||
DebuggerStatement = 208,
|
||||
VariableDeclaration = 209,
|
||||
VariableDeclarationList = 210,
|
||||
FunctionDeclaration = 211,
|
||||
ClassDeclaration = 212,
|
||||
InterfaceDeclaration = 213,
|
||||
TypeAliasDeclaration = 214,
|
||||
EnumDeclaration = 215,
|
||||
ModuleDeclaration = 216,
|
||||
ModuleBlock = 217,
|
||||
CaseBlock = 218,
|
||||
ImportEqualsDeclaration = 219,
|
||||
ImportDeclaration = 220,
|
||||
ImportClause = 221,
|
||||
NamespaceImport = 222,
|
||||
NamedImports = 223,
|
||||
ImportSpecifier = 224,
|
||||
ExportAssignment = 225,
|
||||
ExportDeclaration = 226,
|
||||
NamedExports = 227,
|
||||
ExportSpecifier = 228,
|
||||
MissingDeclaration = 229,
|
||||
ExternalModuleReference = 230,
|
||||
JsxElement = 231,
|
||||
JsxSelfClosingElement = 232,
|
||||
JsxOpeningElement = 233,
|
||||
JsxText = 234,
|
||||
JsxClosingElement = 235,
|
||||
JsxAttribute = 236,
|
||||
JsxSpreadAttribute = 237,
|
||||
JsxExpression = 238,
|
||||
CaseClause = 239,
|
||||
DefaultClause = 240,
|
||||
HeritageClause = 241,
|
||||
CatchClause = 242,
|
||||
PropertyAssignment = 243,
|
||||
ShorthandPropertyAssignment = 244,
|
||||
EnumMember = 245,
|
||||
SourceFile = 246,
|
||||
JSDocTypeExpression = 247,
|
||||
JSDocAllType = 248,
|
||||
JSDocUnknownType = 249,
|
||||
JSDocArrayType = 250,
|
||||
JSDocUnionType = 251,
|
||||
JSDocTupleType = 252,
|
||||
JSDocNullableType = 253,
|
||||
JSDocNonNullableType = 254,
|
||||
JSDocRecordType = 255,
|
||||
JSDocRecordMember = 256,
|
||||
JSDocTypeReference = 257,
|
||||
JSDocOptionalType = 258,
|
||||
JSDocFunctionType = 259,
|
||||
JSDocVariadicType = 260,
|
||||
JSDocConstructorType = 261,
|
||||
JSDocThisType = 262,
|
||||
JSDocComment = 263,
|
||||
JSDocTag = 264,
|
||||
JSDocParameterTag = 265,
|
||||
JSDocReturnTag = 266,
|
||||
JSDocTypeTag = 267,
|
||||
JSDocTemplateTag = 268,
|
||||
SyntaxList = 269,
|
||||
Count = 270,
|
||||
FirstAssignment = 55,
|
||||
LastAssignment = 66,
|
||||
FirstReservedWord = 68,
|
||||
LastReservedWord = 103,
|
||||
FirstKeyword = 68,
|
||||
LastKeyword = 132,
|
||||
FirstFutureReservedWord = 104,
|
||||
LastFutureReservedWord = 112,
|
||||
FirstTypeNode = 149,
|
||||
LastTypeNode = 158,
|
||||
FirstPunctuation = 15,
|
||||
LastPunctuation = 66,
|
||||
FirstToken = 0,
|
||||
LastToken = 131,
|
||||
LastToken = 132,
|
||||
FirstTriviaToken = 2,
|
||||
LastTriviaToken = 6,
|
||||
FirstLiteralToken = 7,
|
||||
LastLiteralToken = 10,
|
||||
FirstTemplateToken = 10,
|
||||
LastTemplateToken = 13,
|
||||
FirstBinaryOperator = 24,
|
||||
LastBinaryOperator = 65,
|
||||
FirstNode = 132,
|
||||
LastTriviaToken = 7,
|
||||
FirstLiteralToken = 8,
|
||||
LastLiteralToken = 11,
|
||||
FirstTemplateToken = 11,
|
||||
LastTemplateToken = 14,
|
||||
FirstBinaryOperator = 25,
|
||||
LastBinaryOperator = 66,
|
||||
FirstNode = 133,
|
||||
}
|
||||
const enum NodeFlags {
|
||||
Export = 1,
|
||||
@@ -452,9 +454,9 @@ declare module "typescript" {
|
||||
* Several node kinds share function-like features such as a signature,
|
||||
* a name, and a body. These nodes should extend FunctionLikeDeclaration.
|
||||
* Examples:
|
||||
* FunctionDeclaration
|
||||
* MethodDeclaration
|
||||
* AccessorDeclaration
|
||||
* - FunctionDeclaration
|
||||
* - MethodDeclaration
|
||||
* - AccessorDeclaration
|
||||
*/
|
||||
interface FunctionLikeDeclaration extends SignatureDeclaration {
|
||||
_functionLikeDeclarationBrand: any;
|
||||
@@ -944,7 +946,7 @@ declare module "typescript" {
|
||||
getSourceFile(fileName: string): SourceFile;
|
||||
getCurrentDirectory(): string;
|
||||
}
|
||||
interface ParseConfigHost {
|
||||
interface ParseConfigHost extends ModuleResolutionHost {
|
||||
readDirectory(rootDir: string, extension: string, exclude: string[]): string[];
|
||||
}
|
||||
interface WriteFileCallback {
|
||||
@@ -958,6 +960,10 @@ declare module "typescript" {
|
||||
throwIfCancellationRequested(): void;
|
||||
}
|
||||
interface Program extends ScriptReferenceHost {
|
||||
/**
|
||||
* Get a list of root file names that were passed to a 'createProgram'
|
||||
*/
|
||||
getRootFileNames(): string[];
|
||||
/**
|
||||
* Get a list of files in the program
|
||||
*/
|
||||
@@ -1019,11 +1025,6 @@ declare module "typescript" {
|
||||
emitSkipped: boolean;
|
||||
diagnostics: Diagnostic[];
|
||||
}
|
||||
interface TypeCheckerHost {
|
||||
getCompilerOptions(): CompilerOptions;
|
||||
getSourceFiles(): SourceFile[];
|
||||
getSourceFile(fileName: string): SourceFile;
|
||||
}
|
||||
interface TypeChecker {
|
||||
getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type;
|
||||
getDeclaredTypeOfSymbol(symbol: Symbol): Type;
|
||||
@@ -1031,6 +1032,7 @@ declare module "typescript" {
|
||||
getPropertyOfType(type: Type, propertyName: string): Symbol;
|
||||
getSignaturesOfType(type: Type, kind: SignatureKind): Signature[];
|
||||
getIndexTypeOfType(type: Type, kind: IndexKind): Type;
|
||||
getBaseTypes(type: InterfaceType): ObjectType[];
|
||||
getReturnTypeOfSignature(signature: Signature): Type;
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
|
||||
getSymbolAtLocation(node: Node): Symbol;
|
||||
@@ -1054,6 +1056,7 @@ declare module "typescript" {
|
||||
getExportsOfModule(moduleSymbol: Symbol): Symbol[];
|
||||
getJsxElementAttributesType(elementNode: JsxOpeningLikeElement): Type;
|
||||
getJsxIntrinsicTagNames(): Symbol[];
|
||||
isOptionalParameter(node: ParameterDeclaration): boolean;
|
||||
}
|
||||
interface SymbolDisplayBuilder {
|
||||
buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
|
||||
@@ -1198,7 +1201,7 @@ declare module "typescript" {
|
||||
Anonymous = 65536,
|
||||
Instantiated = 131072,
|
||||
ObjectLiteral = 524288,
|
||||
ESSymbol = 4194304,
|
||||
ESSymbol = 16777216,
|
||||
StringLike = 258,
|
||||
NumberLike = 132,
|
||||
ObjectType = 80896,
|
||||
@@ -1218,8 +1221,6 @@ declare module "typescript" {
|
||||
typeParameters: TypeParameter[];
|
||||
outerTypeParameters: TypeParameter[];
|
||||
localTypeParameters: TypeParameter[];
|
||||
resolvedBaseConstructorType?: Type;
|
||||
resolvedBaseTypes: ObjectType[];
|
||||
}
|
||||
interface InterfaceTypeWithDeclaredMembers extends InterfaceType {
|
||||
declaredProperties: Symbol[];
|
||||
@@ -1315,6 +1316,7 @@ declare module "typescript" {
|
||||
noLib?: boolean;
|
||||
noResolve?: boolean;
|
||||
out?: string;
|
||||
outFile?: string;
|
||||
outDir?: string;
|
||||
preserveConstEnums?: boolean;
|
||||
project?: string;
|
||||
@@ -1367,14 +1369,25 @@ declare module "typescript" {
|
||||
fileNames: string[];
|
||||
errors: Diagnostic[];
|
||||
}
|
||||
interface CompilerHost {
|
||||
interface ModuleResolutionHost {
|
||||
fileExists(fileName: string): boolean;
|
||||
readFile(fileName: string): string;
|
||||
}
|
||||
interface ResolvedModule {
|
||||
resolvedFileName: string;
|
||||
failedLookupLocations: string[];
|
||||
}
|
||||
type ModuleNameResolver = (moduleName: string, containingFile: string, options: CompilerOptions, host: ModuleResolutionHost) => ResolvedModule;
|
||||
interface CompilerHost extends ModuleResolutionHost {
|
||||
getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile;
|
||||
getCancellationToken?(): CancellationToken;
|
||||
getDefaultLibFileName(options: CompilerOptions): string;
|
||||
writeFile: WriteFileCallback;
|
||||
getCurrentDirectory(): string;
|
||||
getCanonicalFileName(fileName: string): string;
|
||||
useCaseSensitiveFileNames(): boolean;
|
||||
getNewLine(): string;
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string): string[];
|
||||
}
|
||||
interface TextSpan {
|
||||
start: number;
|
||||
@@ -1448,8 +1461,11 @@ declare module "typescript" {
|
||||
function couldStartTrivia(text: string, pos: number): boolean;
|
||||
function getLeadingCommentRanges(text: string, pos: number): CommentRange[];
|
||||
function getTrailingCommentRanges(text: string, pos: number): CommentRange[];
|
||||
/** Optionally, get the shebang */
|
||||
function getShebang(text: string): string;
|
||||
function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean;
|
||||
function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean;
|
||||
function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, text?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner;
|
||||
}
|
||||
declare module "typescript" {
|
||||
function getDefaultLibFileName(options: CompilerOptions): string;
|
||||
@@ -1489,13 +1505,14 @@ declare module "typescript" {
|
||||
function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
|
||||
}
|
||||
declare module "typescript" {
|
||||
/** The version of the TypeScript compiler release */
|
||||
const version: string;
|
||||
function findConfigFile(searchPath: string): string;
|
||||
function resolveTripleslashReference(moduleName: string, containingFile: string): string;
|
||||
function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModule;
|
||||
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
|
||||
function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[];
|
||||
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
|
||||
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
|
||||
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program;
|
||||
}
|
||||
declare module "typescript" {
|
||||
function parseCommandLine(commandLine: string[]): ParsedCommandLine;
|
||||
@@ -1559,6 +1576,7 @@ declare module "typescript" {
|
||||
getConstructSignatures(): Signature[];
|
||||
getStringIndexType(): Type;
|
||||
getNumberIndexType(): Type;
|
||||
getBaseTypes(): ObjectType[];
|
||||
}
|
||||
interface Signature {
|
||||
getDeclaration(): SignatureDeclaration;
|
||||
@@ -1600,6 +1618,7 @@ declare module "typescript" {
|
||||
interface PreProcessedFileInfo {
|
||||
referencedFiles: FileReference[];
|
||||
importedFiles: FileReference[];
|
||||
ambientExternalModules: string[];
|
||||
isLibFile: boolean;
|
||||
}
|
||||
interface HostCancellationToken {
|
||||
@@ -1620,6 +1639,7 @@ declare module "typescript" {
|
||||
trace?(s: string): void;
|
||||
error?(s: string): void;
|
||||
useCaseSensitiveFileNames?(): boolean;
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string): string[];
|
||||
}
|
||||
interface LanguageService {
|
||||
cleanupSemanticCache(): void;
|
||||
@@ -1660,6 +1680,7 @@ declare module "typescript" {
|
||||
getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[];
|
||||
getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[];
|
||||
getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[];
|
||||
getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion;
|
||||
getEmitOutput(fileName: string): EmitOutput;
|
||||
getProgram(): Program;
|
||||
getSourceFile(fileName: string): SourceFile;
|
||||
@@ -1696,6 +1717,11 @@ declare module "typescript" {
|
||||
span: TextSpan;
|
||||
newText: string;
|
||||
}
|
||||
interface TextInsertion {
|
||||
newText: string;
|
||||
/** The position in newText the caret should point to after the insertion. */
|
||||
caretOffset: number;
|
||||
}
|
||||
interface RenameLocation {
|
||||
textSpan: TextSpan;
|
||||
fileName: string;
|
||||
@@ -1716,6 +1742,7 @@ declare module "typescript" {
|
||||
const writtenReference: string;
|
||||
}
|
||||
interface HighlightSpan {
|
||||
fileName?: string;
|
||||
textSpan: TextSpan;
|
||||
kind: string;
|
||||
}
|
||||
@@ -1743,6 +1770,7 @@ declare module "typescript" {
|
||||
InsertSpaceAfterKeywordsInControlFlowStatements: boolean;
|
||||
InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean;
|
||||
InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean;
|
||||
InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean;
|
||||
PlaceOpenBraceOnNewLineForFunctions: boolean;
|
||||
PlaceOpenBraceOnNewLineForControlBlocks: boolean;
|
||||
[s: string]: boolean | number | string;
|
||||
@@ -1985,6 +2013,7 @@ declare module "typescript" {
|
||||
* @param compilationSettings The compilation settings used to acquire the file
|
||||
*/
|
||||
releaseDocument(fileName: string, compilationSettings: CompilerOptions): void;
|
||||
reportStats(): string;
|
||||
}
|
||||
module ScriptElementKind {
|
||||
const unknown: string;
|
||||
@@ -2071,10 +2100,24 @@ declare module "typescript" {
|
||||
}
|
||||
function displayPartsToString(displayParts: SymbolDisplayPart[]): string;
|
||||
function getDefaultCompilerOptions(): CompilerOptions;
|
||||
interface TranspileOptions {
|
||||
compilerOptions?: CompilerOptions;
|
||||
fileName?: string;
|
||||
reportDiagnostics?: boolean;
|
||||
moduleName?: string;
|
||||
renamedDependencies?: Map<string>;
|
||||
}
|
||||
interface TranspileOutput {
|
||||
outputText: string;
|
||||
diagnostics?: Diagnostic[];
|
||||
sourceMapText?: string;
|
||||
}
|
||||
function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput;
|
||||
function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string;
|
||||
function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile;
|
||||
let disableIncrementalParsing: boolean;
|
||||
function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
|
||||
function createGetCanonicalFileName(useCaseSensitivefileNames: boolean): (fileName: string) => string;
|
||||
function createDocumentRegistry(useCaseSensitiveFileNames?: boolean): DocumentRegistry;
|
||||
function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo;
|
||||
function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService;
|
||||
|
||||
+7845
-6469
File diff suppressed because it is too large
Load Diff
Vendored
+343
-301
@@ -23,6 +23,7 @@ declare namespace ts {
|
||||
contains(fileName: string): boolean;
|
||||
remove(fileName: string): void;
|
||||
forEachValue(f: (v: T) => void): void;
|
||||
clear(): void;
|
||||
}
|
||||
interface TextRange {
|
||||
pos: number;
|
||||
@@ -35,293 +36,294 @@ declare namespace ts {
|
||||
MultiLineCommentTrivia = 3,
|
||||
NewLineTrivia = 4,
|
||||
WhitespaceTrivia = 5,
|
||||
ConflictMarkerTrivia = 6,
|
||||
NumericLiteral = 7,
|
||||
StringLiteral = 8,
|
||||
RegularExpressionLiteral = 9,
|
||||
NoSubstitutionTemplateLiteral = 10,
|
||||
TemplateHead = 11,
|
||||
TemplateMiddle = 12,
|
||||
TemplateTail = 13,
|
||||
OpenBraceToken = 14,
|
||||
CloseBraceToken = 15,
|
||||
OpenParenToken = 16,
|
||||
CloseParenToken = 17,
|
||||
OpenBracketToken = 18,
|
||||
CloseBracketToken = 19,
|
||||
DotToken = 20,
|
||||
DotDotDotToken = 21,
|
||||
SemicolonToken = 22,
|
||||
CommaToken = 23,
|
||||
LessThanToken = 24,
|
||||
LessThanSlashToken = 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 = 52,
|
||||
AtToken = 53,
|
||||
EqualsToken = 54,
|
||||
PlusEqualsToken = 55,
|
||||
MinusEqualsToken = 56,
|
||||
AsteriskEqualsToken = 57,
|
||||
SlashEqualsToken = 58,
|
||||
PercentEqualsToken = 59,
|
||||
LessThanLessThanEqualsToken = 60,
|
||||
GreaterThanGreaterThanEqualsToken = 61,
|
||||
GreaterThanGreaterThanGreaterThanEqualsToken = 62,
|
||||
AmpersandEqualsToken = 63,
|
||||
BarEqualsToken = 64,
|
||||
CaretEqualsToken = 65,
|
||||
Identifier = 66,
|
||||
BreakKeyword = 67,
|
||||
CaseKeyword = 68,
|
||||
CatchKeyword = 69,
|
||||
ClassKeyword = 70,
|
||||
ConstKeyword = 71,
|
||||
ContinueKeyword = 72,
|
||||
DebuggerKeyword = 73,
|
||||
DefaultKeyword = 74,
|
||||
DeleteKeyword = 75,
|
||||
DoKeyword = 76,
|
||||
ElseKeyword = 77,
|
||||
EnumKeyword = 78,
|
||||
ExportKeyword = 79,
|
||||
ExtendsKeyword = 80,
|
||||
FalseKeyword = 81,
|
||||
FinallyKeyword = 82,
|
||||
ForKeyword = 83,
|
||||
FunctionKeyword = 84,
|
||||
IfKeyword = 85,
|
||||
ImportKeyword = 86,
|
||||
InKeyword = 87,
|
||||
InstanceOfKeyword = 88,
|
||||
NewKeyword = 89,
|
||||
NullKeyword = 90,
|
||||
ReturnKeyword = 91,
|
||||
SuperKeyword = 92,
|
||||
SwitchKeyword = 93,
|
||||
ThisKeyword = 94,
|
||||
ThrowKeyword = 95,
|
||||
TrueKeyword = 96,
|
||||
TryKeyword = 97,
|
||||
TypeOfKeyword = 98,
|
||||
VarKeyword = 99,
|
||||
VoidKeyword = 100,
|
||||
WhileKeyword = 101,
|
||||
WithKeyword = 102,
|
||||
ImplementsKeyword = 103,
|
||||
InterfaceKeyword = 104,
|
||||
LetKeyword = 105,
|
||||
PackageKeyword = 106,
|
||||
PrivateKeyword = 107,
|
||||
ProtectedKeyword = 108,
|
||||
PublicKeyword = 109,
|
||||
StaticKeyword = 110,
|
||||
YieldKeyword = 111,
|
||||
AbstractKeyword = 112,
|
||||
AsKeyword = 113,
|
||||
AnyKeyword = 114,
|
||||
AsyncKeyword = 115,
|
||||
AwaitKeyword = 116,
|
||||
BooleanKeyword = 117,
|
||||
ConstructorKeyword = 118,
|
||||
DeclareKeyword = 119,
|
||||
GetKeyword = 120,
|
||||
IsKeyword = 121,
|
||||
ModuleKeyword = 122,
|
||||
NamespaceKeyword = 123,
|
||||
RequireKeyword = 124,
|
||||
NumberKeyword = 125,
|
||||
SetKeyword = 126,
|
||||
StringKeyword = 127,
|
||||
SymbolKeyword = 128,
|
||||
TypeKeyword = 129,
|
||||
FromKeyword = 130,
|
||||
OfKeyword = 131,
|
||||
QualifiedName = 132,
|
||||
ComputedPropertyName = 133,
|
||||
TypeParameter = 134,
|
||||
Parameter = 135,
|
||||
Decorator = 136,
|
||||
PropertySignature = 137,
|
||||
PropertyDeclaration = 138,
|
||||
MethodSignature = 139,
|
||||
MethodDeclaration = 140,
|
||||
Constructor = 141,
|
||||
GetAccessor = 142,
|
||||
SetAccessor = 143,
|
||||
CallSignature = 144,
|
||||
ConstructSignature = 145,
|
||||
IndexSignature = 146,
|
||||
TypePredicate = 147,
|
||||
TypeReference = 148,
|
||||
FunctionType = 149,
|
||||
ConstructorType = 150,
|
||||
TypeQuery = 151,
|
||||
TypeLiteral = 152,
|
||||
ArrayType = 153,
|
||||
TupleType = 154,
|
||||
UnionType = 155,
|
||||
IntersectionType = 156,
|
||||
ParenthesizedType = 157,
|
||||
ObjectBindingPattern = 158,
|
||||
ArrayBindingPattern = 159,
|
||||
BindingElement = 160,
|
||||
ArrayLiteralExpression = 161,
|
||||
ObjectLiteralExpression = 162,
|
||||
PropertyAccessExpression = 163,
|
||||
ElementAccessExpression = 164,
|
||||
CallExpression = 165,
|
||||
NewExpression = 166,
|
||||
TaggedTemplateExpression = 167,
|
||||
TypeAssertionExpression = 168,
|
||||
ParenthesizedExpression = 169,
|
||||
FunctionExpression = 170,
|
||||
ArrowFunction = 171,
|
||||
DeleteExpression = 172,
|
||||
TypeOfExpression = 173,
|
||||
VoidExpression = 174,
|
||||
AwaitExpression = 175,
|
||||
PrefixUnaryExpression = 176,
|
||||
PostfixUnaryExpression = 177,
|
||||
BinaryExpression = 178,
|
||||
ConditionalExpression = 179,
|
||||
TemplateExpression = 180,
|
||||
YieldExpression = 181,
|
||||
SpreadElementExpression = 182,
|
||||
ClassExpression = 183,
|
||||
OmittedExpression = 184,
|
||||
ExpressionWithTypeArguments = 185,
|
||||
AsExpression = 186,
|
||||
TemplateSpan = 187,
|
||||
SemicolonClassElement = 188,
|
||||
Block = 189,
|
||||
VariableStatement = 190,
|
||||
EmptyStatement = 191,
|
||||
ExpressionStatement = 192,
|
||||
IfStatement = 193,
|
||||
DoStatement = 194,
|
||||
WhileStatement = 195,
|
||||
ForStatement = 196,
|
||||
ForInStatement = 197,
|
||||
ForOfStatement = 198,
|
||||
ContinueStatement = 199,
|
||||
BreakStatement = 200,
|
||||
ReturnStatement = 201,
|
||||
WithStatement = 202,
|
||||
SwitchStatement = 203,
|
||||
LabeledStatement = 204,
|
||||
ThrowStatement = 205,
|
||||
TryStatement = 206,
|
||||
DebuggerStatement = 207,
|
||||
VariableDeclaration = 208,
|
||||
VariableDeclarationList = 209,
|
||||
FunctionDeclaration = 210,
|
||||
ClassDeclaration = 211,
|
||||
InterfaceDeclaration = 212,
|
||||
TypeAliasDeclaration = 213,
|
||||
EnumDeclaration = 214,
|
||||
ModuleDeclaration = 215,
|
||||
ModuleBlock = 216,
|
||||
CaseBlock = 217,
|
||||
ImportEqualsDeclaration = 218,
|
||||
ImportDeclaration = 219,
|
||||
ImportClause = 220,
|
||||
NamespaceImport = 221,
|
||||
NamedImports = 222,
|
||||
ImportSpecifier = 223,
|
||||
ExportAssignment = 224,
|
||||
ExportDeclaration = 225,
|
||||
NamedExports = 226,
|
||||
ExportSpecifier = 227,
|
||||
MissingDeclaration = 228,
|
||||
ExternalModuleReference = 229,
|
||||
JsxElement = 230,
|
||||
JsxSelfClosingElement = 231,
|
||||
JsxOpeningElement = 232,
|
||||
JsxText = 233,
|
||||
JsxClosingElement = 234,
|
||||
JsxAttribute = 235,
|
||||
JsxSpreadAttribute = 236,
|
||||
JsxExpression = 237,
|
||||
CaseClause = 238,
|
||||
DefaultClause = 239,
|
||||
HeritageClause = 240,
|
||||
CatchClause = 241,
|
||||
PropertyAssignment = 242,
|
||||
ShorthandPropertyAssignment = 243,
|
||||
EnumMember = 244,
|
||||
SourceFile = 245,
|
||||
JSDocTypeExpression = 246,
|
||||
JSDocAllType = 247,
|
||||
JSDocUnknownType = 248,
|
||||
JSDocArrayType = 249,
|
||||
JSDocUnionType = 250,
|
||||
JSDocTupleType = 251,
|
||||
JSDocNullableType = 252,
|
||||
JSDocNonNullableType = 253,
|
||||
JSDocRecordType = 254,
|
||||
JSDocRecordMember = 255,
|
||||
JSDocTypeReference = 256,
|
||||
JSDocOptionalType = 257,
|
||||
JSDocFunctionType = 258,
|
||||
JSDocVariadicType = 259,
|
||||
JSDocConstructorType = 260,
|
||||
JSDocThisType = 261,
|
||||
JSDocComment = 262,
|
||||
JSDocTag = 263,
|
||||
JSDocParameterTag = 264,
|
||||
JSDocReturnTag = 265,
|
||||
JSDocTypeTag = 266,
|
||||
JSDocTemplateTag = 267,
|
||||
SyntaxList = 268,
|
||||
Count = 269,
|
||||
FirstAssignment = 54,
|
||||
LastAssignment = 65,
|
||||
FirstReservedWord = 67,
|
||||
LastReservedWord = 102,
|
||||
FirstKeyword = 67,
|
||||
LastKeyword = 131,
|
||||
FirstFutureReservedWord = 103,
|
||||
LastFutureReservedWord = 111,
|
||||
FirstTypeNode = 148,
|
||||
LastTypeNode = 157,
|
||||
FirstPunctuation = 14,
|
||||
LastPunctuation = 65,
|
||||
ShebangTrivia = 6,
|
||||
ConflictMarkerTrivia = 7,
|
||||
NumericLiteral = 8,
|
||||
StringLiteral = 9,
|
||||
RegularExpressionLiteral = 10,
|
||||
NoSubstitutionTemplateLiteral = 11,
|
||||
TemplateHead = 12,
|
||||
TemplateMiddle = 13,
|
||||
TemplateTail = 14,
|
||||
OpenBraceToken = 15,
|
||||
CloseBraceToken = 16,
|
||||
OpenParenToken = 17,
|
||||
CloseParenToken = 18,
|
||||
OpenBracketToken = 19,
|
||||
CloseBracketToken = 20,
|
||||
DotToken = 21,
|
||||
DotDotDotToken = 22,
|
||||
SemicolonToken = 23,
|
||||
CommaToken = 24,
|
||||
LessThanToken = 25,
|
||||
LessThanSlashToken = 26,
|
||||
GreaterThanToken = 27,
|
||||
LessThanEqualsToken = 28,
|
||||
GreaterThanEqualsToken = 29,
|
||||
EqualsEqualsToken = 30,
|
||||
ExclamationEqualsToken = 31,
|
||||
EqualsEqualsEqualsToken = 32,
|
||||
ExclamationEqualsEqualsToken = 33,
|
||||
EqualsGreaterThanToken = 34,
|
||||
PlusToken = 35,
|
||||
MinusToken = 36,
|
||||
AsteriskToken = 37,
|
||||
SlashToken = 38,
|
||||
PercentToken = 39,
|
||||
PlusPlusToken = 40,
|
||||
MinusMinusToken = 41,
|
||||
LessThanLessThanToken = 42,
|
||||
GreaterThanGreaterThanToken = 43,
|
||||
GreaterThanGreaterThanGreaterThanToken = 44,
|
||||
AmpersandToken = 45,
|
||||
BarToken = 46,
|
||||
CaretToken = 47,
|
||||
ExclamationToken = 48,
|
||||
TildeToken = 49,
|
||||
AmpersandAmpersandToken = 50,
|
||||
BarBarToken = 51,
|
||||
QuestionToken = 52,
|
||||
ColonToken = 53,
|
||||
AtToken = 54,
|
||||
EqualsToken = 55,
|
||||
PlusEqualsToken = 56,
|
||||
MinusEqualsToken = 57,
|
||||
AsteriskEqualsToken = 58,
|
||||
SlashEqualsToken = 59,
|
||||
PercentEqualsToken = 60,
|
||||
LessThanLessThanEqualsToken = 61,
|
||||
GreaterThanGreaterThanEqualsToken = 62,
|
||||
GreaterThanGreaterThanGreaterThanEqualsToken = 63,
|
||||
AmpersandEqualsToken = 64,
|
||||
BarEqualsToken = 65,
|
||||
CaretEqualsToken = 66,
|
||||
Identifier = 67,
|
||||
BreakKeyword = 68,
|
||||
CaseKeyword = 69,
|
||||
CatchKeyword = 70,
|
||||
ClassKeyword = 71,
|
||||
ConstKeyword = 72,
|
||||
ContinueKeyword = 73,
|
||||
DebuggerKeyword = 74,
|
||||
DefaultKeyword = 75,
|
||||
DeleteKeyword = 76,
|
||||
DoKeyword = 77,
|
||||
ElseKeyword = 78,
|
||||
EnumKeyword = 79,
|
||||
ExportKeyword = 80,
|
||||
ExtendsKeyword = 81,
|
||||
FalseKeyword = 82,
|
||||
FinallyKeyword = 83,
|
||||
ForKeyword = 84,
|
||||
FunctionKeyword = 85,
|
||||
IfKeyword = 86,
|
||||
ImportKeyword = 87,
|
||||
InKeyword = 88,
|
||||
InstanceOfKeyword = 89,
|
||||
NewKeyword = 90,
|
||||
NullKeyword = 91,
|
||||
ReturnKeyword = 92,
|
||||
SuperKeyword = 93,
|
||||
SwitchKeyword = 94,
|
||||
ThisKeyword = 95,
|
||||
ThrowKeyword = 96,
|
||||
TrueKeyword = 97,
|
||||
TryKeyword = 98,
|
||||
TypeOfKeyword = 99,
|
||||
VarKeyword = 100,
|
||||
VoidKeyword = 101,
|
||||
WhileKeyword = 102,
|
||||
WithKeyword = 103,
|
||||
ImplementsKeyword = 104,
|
||||
InterfaceKeyword = 105,
|
||||
LetKeyword = 106,
|
||||
PackageKeyword = 107,
|
||||
PrivateKeyword = 108,
|
||||
ProtectedKeyword = 109,
|
||||
PublicKeyword = 110,
|
||||
StaticKeyword = 111,
|
||||
YieldKeyword = 112,
|
||||
AbstractKeyword = 113,
|
||||
AsKeyword = 114,
|
||||
AnyKeyword = 115,
|
||||
AsyncKeyword = 116,
|
||||
AwaitKeyword = 117,
|
||||
BooleanKeyword = 118,
|
||||
ConstructorKeyword = 119,
|
||||
DeclareKeyword = 120,
|
||||
GetKeyword = 121,
|
||||
IsKeyword = 122,
|
||||
ModuleKeyword = 123,
|
||||
NamespaceKeyword = 124,
|
||||
RequireKeyword = 125,
|
||||
NumberKeyword = 126,
|
||||
SetKeyword = 127,
|
||||
StringKeyword = 128,
|
||||
SymbolKeyword = 129,
|
||||
TypeKeyword = 130,
|
||||
FromKeyword = 131,
|
||||
OfKeyword = 132,
|
||||
QualifiedName = 133,
|
||||
ComputedPropertyName = 134,
|
||||
TypeParameter = 135,
|
||||
Parameter = 136,
|
||||
Decorator = 137,
|
||||
PropertySignature = 138,
|
||||
PropertyDeclaration = 139,
|
||||
MethodSignature = 140,
|
||||
MethodDeclaration = 141,
|
||||
Constructor = 142,
|
||||
GetAccessor = 143,
|
||||
SetAccessor = 144,
|
||||
CallSignature = 145,
|
||||
ConstructSignature = 146,
|
||||
IndexSignature = 147,
|
||||
TypePredicate = 148,
|
||||
TypeReference = 149,
|
||||
FunctionType = 150,
|
||||
ConstructorType = 151,
|
||||
TypeQuery = 152,
|
||||
TypeLiteral = 153,
|
||||
ArrayType = 154,
|
||||
TupleType = 155,
|
||||
UnionType = 156,
|
||||
IntersectionType = 157,
|
||||
ParenthesizedType = 158,
|
||||
ObjectBindingPattern = 159,
|
||||
ArrayBindingPattern = 160,
|
||||
BindingElement = 161,
|
||||
ArrayLiteralExpression = 162,
|
||||
ObjectLiteralExpression = 163,
|
||||
PropertyAccessExpression = 164,
|
||||
ElementAccessExpression = 165,
|
||||
CallExpression = 166,
|
||||
NewExpression = 167,
|
||||
TaggedTemplateExpression = 168,
|
||||
TypeAssertionExpression = 169,
|
||||
ParenthesizedExpression = 170,
|
||||
FunctionExpression = 171,
|
||||
ArrowFunction = 172,
|
||||
DeleteExpression = 173,
|
||||
TypeOfExpression = 174,
|
||||
VoidExpression = 175,
|
||||
AwaitExpression = 176,
|
||||
PrefixUnaryExpression = 177,
|
||||
PostfixUnaryExpression = 178,
|
||||
BinaryExpression = 179,
|
||||
ConditionalExpression = 180,
|
||||
TemplateExpression = 181,
|
||||
YieldExpression = 182,
|
||||
SpreadElementExpression = 183,
|
||||
ClassExpression = 184,
|
||||
OmittedExpression = 185,
|
||||
ExpressionWithTypeArguments = 186,
|
||||
AsExpression = 187,
|
||||
TemplateSpan = 188,
|
||||
SemicolonClassElement = 189,
|
||||
Block = 190,
|
||||
VariableStatement = 191,
|
||||
EmptyStatement = 192,
|
||||
ExpressionStatement = 193,
|
||||
IfStatement = 194,
|
||||
DoStatement = 195,
|
||||
WhileStatement = 196,
|
||||
ForStatement = 197,
|
||||
ForInStatement = 198,
|
||||
ForOfStatement = 199,
|
||||
ContinueStatement = 200,
|
||||
BreakStatement = 201,
|
||||
ReturnStatement = 202,
|
||||
WithStatement = 203,
|
||||
SwitchStatement = 204,
|
||||
LabeledStatement = 205,
|
||||
ThrowStatement = 206,
|
||||
TryStatement = 207,
|
||||
DebuggerStatement = 208,
|
||||
VariableDeclaration = 209,
|
||||
VariableDeclarationList = 210,
|
||||
FunctionDeclaration = 211,
|
||||
ClassDeclaration = 212,
|
||||
InterfaceDeclaration = 213,
|
||||
TypeAliasDeclaration = 214,
|
||||
EnumDeclaration = 215,
|
||||
ModuleDeclaration = 216,
|
||||
ModuleBlock = 217,
|
||||
CaseBlock = 218,
|
||||
ImportEqualsDeclaration = 219,
|
||||
ImportDeclaration = 220,
|
||||
ImportClause = 221,
|
||||
NamespaceImport = 222,
|
||||
NamedImports = 223,
|
||||
ImportSpecifier = 224,
|
||||
ExportAssignment = 225,
|
||||
ExportDeclaration = 226,
|
||||
NamedExports = 227,
|
||||
ExportSpecifier = 228,
|
||||
MissingDeclaration = 229,
|
||||
ExternalModuleReference = 230,
|
||||
JsxElement = 231,
|
||||
JsxSelfClosingElement = 232,
|
||||
JsxOpeningElement = 233,
|
||||
JsxText = 234,
|
||||
JsxClosingElement = 235,
|
||||
JsxAttribute = 236,
|
||||
JsxSpreadAttribute = 237,
|
||||
JsxExpression = 238,
|
||||
CaseClause = 239,
|
||||
DefaultClause = 240,
|
||||
HeritageClause = 241,
|
||||
CatchClause = 242,
|
||||
PropertyAssignment = 243,
|
||||
ShorthandPropertyAssignment = 244,
|
||||
EnumMember = 245,
|
||||
SourceFile = 246,
|
||||
JSDocTypeExpression = 247,
|
||||
JSDocAllType = 248,
|
||||
JSDocUnknownType = 249,
|
||||
JSDocArrayType = 250,
|
||||
JSDocUnionType = 251,
|
||||
JSDocTupleType = 252,
|
||||
JSDocNullableType = 253,
|
||||
JSDocNonNullableType = 254,
|
||||
JSDocRecordType = 255,
|
||||
JSDocRecordMember = 256,
|
||||
JSDocTypeReference = 257,
|
||||
JSDocOptionalType = 258,
|
||||
JSDocFunctionType = 259,
|
||||
JSDocVariadicType = 260,
|
||||
JSDocConstructorType = 261,
|
||||
JSDocThisType = 262,
|
||||
JSDocComment = 263,
|
||||
JSDocTag = 264,
|
||||
JSDocParameterTag = 265,
|
||||
JSDocReturnTag = 266,
|
||||
JSDocTypeTag = 267,
|
||||
JSDocTemplateTag = 268,
|
||||
SyntaxList = 269,
|
||||
Count = 270,
|
||||
FirstAssignment = 55,
|
||||
LastAssignment = 66,
|
||||
FirstReservedWord = 68,
|
||||
LastReservedWord = 103,
|
||||
FirstKeyword = 68,
|
||||
LastKeyword = 132,
|
||||
FirstFutureReservedWord = 104,
|
||||
LastFutureReservedWord = 112,
|
||||
FirstTypeNode = 149,
|
||||
LastTypeNode = 158,
|
||||
FirstPunctuation = 15,
|
||||
LastPunctuation = 66,
|
||||
FirstToken = 0,
|
||||
LastToken = 131,
|
||||
LastToken = 132,
|
||||
FirstTriviaToken = 2,
|
||||
LastTriviaToken = 6,
|
||||
FirstLiteralToken = 7,
|
||||
LastLiteralToken = 10,
|
||||
FirstTemplateToken = 10,
|
||||
LastTemplateToken = 13,
|
||||
FirstBinaryOperator = 24,
|
||||
LastBinaryOperator = 65,
|
||||
FirstNode = 132,
|
||||
LastTriviaToken = 7,
|
||||
FirstLiteralToken = 8,
|
||||
LastLiteralToken = 11,
|
||||
FirstTemplateToken = 11,
|
||||
LastTemplateToken = 14,
|
||||
FirstBinaryOperator = 25,
|
||||
LastBinaryOperator = 66,
|
||||
FirstNode = 133,
|
||||
}
|
||||
const enum NodeFlags {
|
||||
Export = 1,
|
||||
@@ -452,9 +454,9 @@ declare namespace ts {
|
||||
* Several node kinds share function-like features such as a signature,
|
||||
* a name, and a body. These nodes should extend FunctionLikeDeclaration.
|
||||
* Examples:
|
||||
* FunctionDeclaration
|
||||
* MethodDeclaration
|
||||
* AccessorDeclaration
|
||||
* - FunctionDeclaration
|
||||
* - MethodDeclaration
|
||||
* - AccessorDeclaration
|
||||
*/
|
||||
interface FunctionLikeDeclaration extends SignatureDeclaration {
|
||||
_functionLikeDeclarationBrand: any;
|
||||
@@ -944,7 +946,7 @@ declare namespace ts {
|
||||
getSourceFile(fileName: string): SourceFile;
|
||||
getCurrentDirectory(): string;
|
||||
}
|
||||
interface ParseConfigHost {
|
||||
interface ParseConfigHost extends ModuleResolutionHost {
|
||||
readDirectory(rootDir: string, extension: string, exclude: string[]): string[];
|
||||
}
|
||||
interface WriteFileCallback {
|
||||
@@ -958,6 +960,10 @@ declare namespace ts {
|
||||
throwIfCancellationRequested(): void;
|
||||
}
|
||||
interface Program extends ScriptReferenceHost {
|
||||
/**
|
||||
* Get a list of root file names that were passed to a 'createProgram'
|
||||
*/
|
||||
getRootFileNames(): string[];
|
||||
/**
|
||||
* Get a list of files in the program
|
||||
*/
|
||||
@@ -1019,11 +1025,6 @@ declare namespace ts {
|
||||
emitSkipped: boolean;
|
||||
diagnostics: Diagnostic[];
|
||||
}
|
||||
interface TypeCheckerHost {
|
||||
getCompilerOptions(): CompilerOptions;
|
||||
getSourceFiles(): SourceFile[];
|
||||
getSourceFile(fileName: string): SourceFile;
|
||||
}
|
||||
interface TypeChecker {
|
||||
getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type;
|
||||
getDeclaredTypeOfSymbol(symbol: Symbol): Type;
|
||||
@@ -1031,6 +1032,7 @@ declare namespace ts {
|
||||
getPropertyOfType(type: Type, propertyName: string): Symbol;
|
||||
getSignaturesOfType(type: Type, kind: SignatureKind): Signature[];
|
||||
getIndexTypeOfType(type: Type, kind: IndexKind): Type;
|
||||
getBaseTypes(type: InterfaceType): ObjectType[];
|
||||
getReturnTypeOfSignature(signature: Signature): Type;
|
||||
getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
|
||||
getSymbolAtLocation(node: Node): Symbol;
|
||||
@@ -1054,6 +1056,7 @@ declare namespace ts {
|
||||
getExportsOfModule(moduleSymbol: Symbol): Symbol[];
|
||||
getJsxElementAttributesType(elementNode: JsxOpeningLikeElement): Type;
|
||||
getJsxIntrinsicTagNames(): Symbol[];
|
||||
isOptionalParameter(node: ParameterDeclaration): boolean;
|
||||
}
|
||||
interface SymbolDisplayBuilder {
|
||||
buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void;
|
||||
@@ -1198,7 +1201,7 @@ declare namespace ts {
|
||||
Anonymous = 65536,
|
||||
Instantiated = 131072,
|
||||
ObjectLiteral = 524288,
|
||||
ESSymbol = 4194304,
|
||||
ESSymbol = 16777216,
|
||||
StringLike = 258,
|
||||
NumberLike = 132,
|
||||
ObjectType = 80896,
|
||||
@@ -1218,8 +1221,6 @@ declare namespace ts {
|
||||
typeParameters: TypeParameter[];
|
||||
outerTypeParameters: TypeParameter[];
|
||||
localTypeParameters: TypeParameter[];
|
||||
resolvedBaseConstructorType?: Type;
|
||||
resolvedBaseTypes: ObjectType[];
|
||||
}
|
||||
interface InterfaceTypeWithDeclaredMembers extends InterfaceType {
|
||||
declaredProperties: Symbol[];
|
||||
@@ -1315,6 +1316,7 @@ declare namespace ts {
|
||||
noLib?: boolean;
|
||||
noResolve?: boolean;
|
||||
out?: string;
|
||||
outFile?: string;
|
||||
outDir?: string;
|
||||
preserveConstEnums?: boolean;
|
||||
project?: string;
|
||||
@@ -1367,14 +1369,25 @@ declare namespace ts {
|
||||
fileNames: string[];
|
||||
errors: Diagnostic[];
|
||||
}
|
||||
interface CompilerHost {
|
||||
interface ModuleResolutionHost {
|
||||
fileExists(fileName: string): boolean;
|
||||
readFile(fileName: string): string;
|
||||
}
|
||||
interface ResolvedModule {
|
||||
resolvedFileName: string;
|
||||
failedLookupLocations: string[];
|
||||
}
|
||||
type ModuleNameResolver = (moduleName: string, containingFile: string, options: CompilerOptions, host: ModuleResolutionHost) => ResolvedModule;
|
||||
interface CompilerHost extends ModuleResolutionHost {
|
||||
getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile;
|
||||
getCancellationToken?(): CancellationToken;
|
||||
getDefaultLibFileName(options: CompilerOptions): string;
|
||||
writeFile: WriteFileCallback;
|
||||
getCurrentDirectory(): string;
|
||||
getCanonicalFileName(fileName: string): string;
|
||||
useCaseSensitiveFileNames(): boolean;
|
||||
getNewLine(): string;
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string): string[];
|
||||
}
|
||||
interface TextSpan {
|
||||
start: number;
|
||||
@@ -1448,9 +1461,11 @@ declare namespace ts {
|
||||
function couldStartTrivia(text: string, pos: number): boolean;
|
||||
function getLeadingCommentRanges(text: string, pos: number): CommentRange[];
|
||||
function getTrailingCommentRanges(text: string, pos: number): CommentRange[];
|
||||
/** Optionally, get the shebang */
|
||||
function getShebang(text: string): string;
|
||||
function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean;
|
||||
function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean;
|
||||
function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant: ts.LanguageVariant, text?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner;
|
||||
function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, text?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner;
|
||||
}
|
||||
declare namespace ts {
|
||||
function getDefaultLibFileName(options: CompilerOptions): string;
|
||||
@@ -1490,13 +1505,14 @@ declare namespace ts {
|
||||
function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
|
||||
}
|
||||
declare namespace ts {
|
||||
/** The version of the TypeScript compiler release */
|
||||
const version: string;
|
||||
function findConfigFile(searchPath: string): string;
|
||||
function resolveTripleslashReference(moduleName: string, containingFile: string): string;
|
||||
function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModule;
|
||||
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
|
||||
function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[];
|
||||
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
|
||||
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
|
||||
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program;
|
||||
}
|
||||
declare namespace ts {
|
||||
function parseCommandLine(commandLine: string[]): ParsedCommandLine;
|
||||
@@ -1560,6 +1576,7 @@ declare namespace ts {
|
||||
getConstructSignatures(): Signature[];
|
||||
getStringIndexType(): Type;
|
||||
getNumberIndexType(): Type;
|
||||
getBaseTypes(): ObjectType[];
|
||||
}
|
||||
interface Signature {
|
||||
getDeclaration(): SignatureDeclaration;
|
||||
@@ -1601,6 +1618,7 @@ declare namespace ts {
|
||||
interface PreProcessedFileInfo {
|
||||
referencedFiles: FileReference[];
|
||||
importedFiles: FileReference[];
|
||||
ambientExternalModules: string[];
|
||||
isLibFile: boolean;
|
||||
}
|
||||
interface HostCancellationToken {
|
||||
@@ -1621,6 +1639,7 @@ declare namespace ts {
|
||||
trace?(s: string): void;
|
||||
error?(s: string): void;
|
||||
useCaseSensitiveFileNames?(): boolean;
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string): string[];
|
||||
}
|
||||
interface LanguageService {
|
||||
cleanupSemanticCache(): void;
|
||||
@@ -1661,6 +1680,7 @@ declare namespace ts {
|
||||
getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[];
|
||||
getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[];
|
||||
getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[];
|
||||
getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion;
|
||||
getEmitOutput(fileName: string): EmitOutput;
|
||||
getProgram(): Program;
|
||||
getSourceFile(fileName: string): SourceFile;
|
||||
@@ -1697,6 +1717,11 @@ declare namespace ts {
|
||||
span: TextSpan;
|
||||
newText: string;
|
||||
}
|
||||
interface TextInsertion {
|
||||
newText: string;
|
||||
/** The position in newText the caret should point to after the insertion. */
|
||||
caretOffset: number;
|
||||
}
|
||||
interface RenameLocation {
|
||||
textSpan: TextSpan;
|
||||
fileName: string;
|
||||
@@ -1717,6 +1742,7 @@ declare namespace ts {
|
||||
const writtenReference: string;
|
||||
}
|
||||
interface HighlightSpan {
|
||||
fileName?: string;
|
||||
textSpan: TextSpan;
|
||||
kind: string;
|
||||
}
|
||||
@@ -1744,6 +1770,7 @@ declare namespace ts {
|
||||
InsertSpaceAfterKeywordsInControlFlowStatements: boolean;
|
||||
InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean;
|
||||
InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean;
|
||||
InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean;
|
||||
PlaceOpenBraceOnNewLineForFunctions: boolean;
|
||||
PlaceOpenBraceOnNewLineForControlBlocks: boolean;
|
||||
[s: string]: boolean | number | string;
|
||||
@@ -1986,6 +2013,7 @@ declare namespace ts {
|
||||
* @param compilationSettings The compilation settings used to acquire the file
|
||||
*/
|
||||
releaseDocument(fileName: string, compilationSettings: CompilerOptions): void;
|
||||
reportStats(): string;
|
||||
}
|
||||
module ScriptElementKind {
|
||||
const unknown: string;
|
||||
@@ -2072,10 +2100,24 @@ declare namespace ts {
|
||||
}
|
||||
function displayPartsToString(displayParts: SymbolDisplayPart[]): string;
|
||||
function getDefaultCompilerOptions(): CompilerOptions;
|
||||
interface TranspileOptions {
|
||||
compilerOptions?: CompilerOptions;
|
||||
fileName?: string;
|
||||
reportDiagnostics?: boolean;
|
||||
moduleName?: string;
|
||||
renamedDependencies?: Map<string>;
|
||||
}
|
||||
interface TranspileOutput {
|
||||
outputText: string;
|
||||
diagnostics?: Diagnostic[];
|
||||
sourceMapText?: string;
|
||||
}
|
||||
function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput;
|
||||
function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string;
|
||||
function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile;
|
||||
let disableIncrementalParsing: boolean;
|
||||
function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
|
||||
function createGetCanonicalFileName(useCaseSensitivefileNames: boolean): (fileName: string) => string;
|
||||
function createDocumentRegistry(useCaseSensitiveFileNames?: boolean): DocumentRegistry;
|
||||
function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo;
|
||||
function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService;
|
||||
|
||||
+7845
-6469
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -49,5 +49,5 @@
|
||||
"fs": false,
|
||||
"os": false,
|
||||
"path": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+20
-5
@@ -388,7 +388,7 @@ namespace ts {
|
||||
return node1.pos <= node2.pos;
|
||||
}
|
||||
|
||||
if (!compilerOptions.out) {
|
||||
if (!compilerOptions.outFile && !compilerOptions.out) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -11384,9 +11384,16 @@ namespace ts {
|
||||
// serialize the type metadata.
|
||||
if (node && node.kind === SyntaxKind.TypeReference) {
|
||||
let root = getFirstIdentifier((<TypeReferenceNode>node).typeName);
|
||||
let rootSymbol = resolveName(root, root.text, SymbolFlags.Value, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined);
|
||||
if (rootSymbol && rootSymbol.flags & SymbolFlags.Alias && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol))) {
|
||||
markAliasSymbolAsReferenced(rootSymbol);
|
||||
let meaning = root.parent.kind === SyntaxKind.TypeReference ? SymbolFlags.Type : SymbolFlags.Namespace;
|
||||
// Resolve type so we know which symbol is referenced
|
||||
let rootSymbol = resolveName(root, root.text, meaning | SymbolFlags.Alias, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined);
|
||||
// Resolved symbol is alias
|
||||
if (rootSymbol && rootSymbol.flags & SymbolFlags.Alias) {
|
||||
let aliasTarget = resolveAlias(rootSymbol);
|
||||
// If alias has value symbol - mark alias as referenced
|
||||
if (aliasTarget.flags & SymbolFlags.Value && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol))) {
|
||||
markAliasSymbolAsReferenced(rootSymbol);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13845,7 +13852,11 @@ namespace ts {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (introducesArgumentsExoticObject(location)) {
|
||||
copySymbol(argumentsSymbol, meaning);
|
||||
}
|
||||
|
||||
memberFlags = location.flags;
|
||||
location = location.parent;
|
||||
}
|
||||
@@ -14398,6 +14409,10 @@ namespace ts {
|
||||
|
||||
// Resolve the symbol as a type so that we can provide a more useful hint for the type serializer.
|
||||
let typeSymbol = resolveEntityName(typeName, SymbolFlags.Type, /*ignoreErrors*/ true);
|
||||
// We might not be able to resolve type symbol so use unknown type in that case (eg error case)
|
||||
if (!typeSymbol) {
|
||||
return TypeReferenceSerializationKind.ObjectType;
|
||||
}
|
||||
let type = getDeclaredTypeOfSymbol(typeSymbol);
|
||||
if (type === unknownType) {
|
||||
return TypeReferenceSerializationKind.Unknown;
|
||||
|
||||
@@ -120,6 +120,13 @@ namespace ts {
|
||||
{
|
||||
name: "out",
|
||||
type: "string",
|
||||
isFilePath: false, // This is intentionally broken to support compatability with existing tsconfig files
|
||||
// for correct behaviour, please use outFile
|
||||
paramType: Diagnostics.FILE,
|
||||
},
|
||||
{
|
||||
name: "outFile",
|
||||
type: "string",
|
||||
isFilePath: true,
|
||||
description: Diagnostics.Concatenate_and_emit_output_to_single_file,
|
||||
paramType: Diagnostics.FILE,
|
||||
|
||||
@@ -1574,7 +1574,7 @@ namespace ts {
|
||||
? referencedFile.fileName // Declaration file, use declaration file name
|
||||
: shouldEmitToOwnFile(referencedFile, compilerOptions)
|
||||
? getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") // Own output file so get the .d.ts file
|
||||
: removeFileExtension(compilerOptions.out) + ".d.ts"; // Global out file
|
||||
: removeFileExtension(compilerOptions.outFile || compilerOptions.out) + ".d.ts"; // Global out file
|
||||
|
||||
declFileName = getRelativePathToDirectoryOrUrl(
|
||||
getDirectoryPath(normalizeSlashes(jsFilePath)),
|
||||
|
||||
@@ -506,19 +506,11 @@ namespace ts {
|
||||
Unknown_compiler_option_0: { code: 5023, category: DiagnosticCategory.Error, key: "Unknown compiler option '{0}'." },
|
||||
Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: DiagnosticCategory.Error, key: "Compiler option '{0}' requires a value of type {1}." },
|
||||
Could_not_write_file_0_Colon_1: { code: 5033, category: DiagnosticCategory.Error, key: "Could not write file '{0}': {1}" },
|
||||
Option_mapRoot_cannot_be_specified_without_specifying_sourceMap_option: { code: 5038, category: DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified without specifying 'sourceMap' option." },
|
||||
Option_sourceRoot_cannot_be_specified_without_specifying_sourceMap_option: { code: 5039, category: DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified without specifying 'sourceMap' option." },
|
||||
Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." },
|
||||
Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'declaration'." },
|
||||
Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: DiagnosticCategory.Error, key: "Option 'project' cannot be mixed with source files on a command line." },
|
||||
Option_declaration_cannot_be_specified_with_option_isolatedModules: { code: 5044, category: DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'isolatedModules'." },
|
||||
Option_noEmitOnError_cannot_be_specified_with_option_isolatedModules: { code: 5045, category: DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'isolatedModules'." },
|
||||
Option_out_cannot_be_specified_with_option_isolatedModules: { code: 5046, category: DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'isolatedModules'." },
|
||||
Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: DiagnosticCategory.Error, key: "Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." },
|
||||
Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap: { code: 5048, category: DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'inlineSourceMap'." },
|
||||
Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5049, category: DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'." },
|
||||
Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5050, category: DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified with option 'inlineSourceMap'." },
|
||||
Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { code: 5051, category: DiagnosticCategory.Error, key: "Option 'inlineSources' can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided." },
|
||||
Option_0_cannot_be_specified_without_specifying_option_1: { code: 5052, category: DiagnosticCategory.Error, key: "Option '{0}' cannot be specified without specifying option '{1}'." },
|
||||
Option_0_cannot_be_specified_with_option_1: { code: 5053, category: DiagnosticCategory.Error, key: "Option '{0}' cannot be specified with option '{1}'." },
|
||||
Concatenate_and_emit_output_to_single_file: { code: 6001, category: DiagnosticCategory.Message, key: "Concatenate and emit output to single file." },
|
||||
Generates_corresponding_d_ts_file: { code: 6002, category: DiagnosticCategory.Message, key: "Generates corresponding '.d.ts' file." },
|
||||
Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: DiagnosticCategory.Message, key: "Specifies the location where debugger should locate map files instead of generated locations." },
|
||||
@@ -569,7 +561,6 @@ namespace ts {
|
||||
Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." },
|
||||
Specify_JSX_code_generation_Colon_preserve_or_react: { code: 6080, category: DiagnosticCategory.Message, key: "Specify JSX code generation: 'preserve' or 'react'" },
|
||||
Argument_for_jsx_must_be_preserve_or_react: { code: 6081, category: DiagnosticCategory.Message, key: "Argument for '--jsx' must be 'preserve' or 'react'." },
|
||||
Option_experimentalDecorators_must_also_be_specified_when_option_emitDecoratorMetadata_is_specified: { code: 6064, category: DiagnosticCategory.Error, key: "Option 'experimentalDecorators' must also be specified when option 'emitDecoratorMetadata' is specified." },
|
||||
Enables_experimental_support_for_ES7_decorators: { code: 6065, category: DiagnosticCategory.Message, key: "Enables experimental support for ES7 decorators." },
|
||||
Enables_experimental_support_for_emitting_type_metadata_for_decorators: { code: 6066, category: DiagnosticCategory.Message, key: "Enables experimental support for emitting type metadata for decorators." },
|
||||
Option_experimentalAsyncFunctions_cannot_be_specified_when_targeting_ES5_or_lower: { code: 6067, category: DiagnosticCategory.Message, key: "Option 'experimentalAsyncFunctions' cannot be specified when targeting ES5 or lower." },
|
||||
|
||||
@@ -2013,59 +2013,27 @@
|
||||
"category": "Error",
|
||||
"code": 5033
|
||||
},
|
||||
"Option 'mapRoot' cannot be specified without specifying 'sourceMap' option.": {
|
||||
"category": "Error",
|
||||
"code": 5038
|
||||
},
|
||||
"Option 'sourceRoot' cannot be specified without specifying 'sourceMap' option.": {
|
||||
"category": "Error",
|
||||
"code": 5039
|
||||
},
|
||||
"Option 'noEmit' cannot be specified with option 'out' or 'outDir'.": {
|
||||
"category": "Error",
|
||||
"code": 5040
|
||||
},
|
||||
"Option 'noEmit' cannot be specified with option 'declaration'.": {
|
||||
"category": "Error",
|
||||
"code": 5041
|
||||
},
|
||||
"Option 'project' cannot be mixed with source files on a command line.": {
|
||||
"category": "Error",
|
||||
"code": 5042
|
||||
},
|
||||
"Option 'declaration' cannot be specified with option 'isolatedModules'.": {
|
||||
"category": "Error",
|
||||
"code": 5044
|
||||
},
|
||||
"Option 'noEmitOnError' cannot be specified with option 'isolatedModules'.": {
|
||||
"category": "Error",
|
||||
"code": 5045
|
||||
},
|
||||
"Option 'out' cannot be specified with option 'isolatedModules'.": {
|
||||
"category": "Error",
|
||||
"code": 5046
|
||||
},
|
||||
"Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher.": {
|
||||
"category": "Error",
|
||||
"code": 5047
|
||||
},
|
||||
"Option 'sourceMap' cannot be specified with option 'inlineSourceMap'.": {
|
||||
"category": "Error",
|
||||
"code": 5048
|
||||
},
|
||||
"Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'.": {
|
||||
"category": "Error",
|
||||
"code": 5049
|
||||
},
|
||||
"Option 'mapRoot' cannot be specified with option 'inlineSourceMap'.": {
|
||||
"category": "Error",
|
||||
"code": 5050
|
||||
},
|
||||
"Option 'inlineSources' can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided.": {
|
||||
"category": "Error",
|
||||
"code": 5051
|
||||
},
|
||||
|
||||
"Option '{0}' cannot be specified without specifying option '{1}'.": {
|
||||
"category": "Error",
|
||||
"code": 5052
|
||||
},
|
||||
"Option '{0}' cannot be specified with option '{1}'.": {
|
||||
"category": "Error",
|
||||
"code": 5053
|
||||
},
|
||||
|
||||
"Concatenate and emit output to single file.": {
|
||||
"category": "Message",
|
||||
"code": 6001
|
||||
@@ -2266,10 +2234,6 @@
|
||||
"category": "Message",
|
||||
"code": 6081
|
||||
},
|
||||
"Option 'experimentalDecorators' must also be specified when option 'emitDecoratorMetadata' is specified.": {
|
||||
"category": "Error",
|
||||
"code": 6064
|
||||
},
|
||||
"Enables experimental support for ES7 decorators.": {
|
||||
"category": "Message",
|
||||
"code": 6065
|
||||
@@ -2290,6 +2254,7 @@
|
||||
"category": "Message",
|
||||
"code": 6069
|
||||
},
|
||||
|
||||
"Variable '{0}' implicitly has an '{1}' type.": {
|
||||
"category": "Error",
|
||||
"code": 7005
|
||||
|
||||
+291
-14
@@ -78,18 +78,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
}
|
||||
});
|
||||
|
||||
if (compilerOptions.out) {
|
||||
emitFile(compilerOptions.out);
|
||||
if (compilerOptions.outFile || compilerOptions.out) {
|
||||
emitFile(compilerOptions.outFile || compilerOptions.out);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// targetSourceFile is specified (e.g calling emitter from language service or calling getSemanticDiagnostic from language service)
|
||||
if (shouldEmitToOwnFile(targetSourceFile, compilerOptions)) {
|
||||
let jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, forEach(host.getSourceFiles(), shouldEmitJsx) ? ".jsx" : ".js");
|
||||
let jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, shouldEmitJsx(targetSourceFile) ? ".jsx" : ".js");
|
||||
emitFile(jsFilePath, targetSourceFile);
|
||||
}
|
||||
else if (!isDeclarationFile(targetSourceFile) && compilerOptions.out) {
|
||||
emitFile(compilerOptions.out);
|
||||
else if (!isDeclarationFile(targetSourceFile) && (compilerOptions.outFile || compilerOptions.out)) {
|
||||
emitFile(compilerOptions.outFile || compilerOptions.out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1519,7 +1519,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
return;
|
||||
}
|
||||
}
|
||||
writeTextOfNode(currentSourceFile, node);
|
||||
|
||||
if (nodeIsSynthesized(node)) {
|
||||
write(node.text);
|
||||
}
|
||||
else {
|
||||
writeTextOfNode(currentSourceFile, node);
|
||||
}
|
||||
}
|
||||
|
||||
function isNameOfNestedRedeclaration(node: Identifier) {
|
||||
@@ -1546,6 +1552,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
else if (isNameOfNestedRedeclaration(node)) {
|
||||
write(getGeneratedNameForNode(node));
|
||||
}
|
||||
else if (nodeIsSynthesized(node)) {
|
||||
write(node.text);
|
||||
}
|
||||
else {
|
||||
writeTextOfNode(currentSourceFile, node);
|
||||
}
|
||||
@@ -5131,7 +5140,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
argumentsWritten++;
|
||||
}
|
||||
if (shouldEmitParamTypesMetadata(node)) {
|
||||
debugger;
|
||||
if (writeComma || argumentsWritten) {
|
||||
write(", ");
|
||||
}
|
||||
@@ -6513,9 +6521,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
}
|
||||
}
|
||||
|
||||
function trimReactWhitespace(node: JsxText): string {
|
||||
function trimReactWhitespaceAndApplyEntities(node: JsxText): string {
|
||||
let result: string = undefined;
|
||||
let text = getTextOfNode(node);
|
||||
let text = getTextOfNode(node, /*includeTrivia*/ true);
|
||||
let firstNonWhitespace = 0;
|
||||
let lastNonWhitespace = -1;
|
||||
|
||||
@@ -6538,19 +6546,32 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (firstNonWhitespace !== -1) {
|
||||
let part = text.substr(firstNonWhitespace);
|
||||
result = (result ? result + "\" + ' ' + \"" : "") + part;
|
||||
}
|
||||
|
||||
if (result) {
|
||||
// Replace entities like
|
||||
result = result.replace(/&(\w+);/g, function(s: any, m: string) {
|
||||
if (entities[m] !== undefined) {
|
||||
return String.fromCharCode(entities[m]);
|
||||
}
|
||||
else {
|
||||
return s;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function getTextToEmit(node: JsxText) {
|
||||
switch (compilerOptions.jsx) {
|
||||
case JsxEmit.React:
|
||||
let text = trimReactWhitespace(node);
|
||||
if (text.length === 0) {
|
||||
let text = trimReactWhitespaceAndApplyEntities(node);
|
||||
if (text === undefined || text.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
else {
|
||||
@@ -6558,7 +6579,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
}
|
||||
case JsxEmit.Preserve:
|
||||
default:
|
||||
return getTextOfNode(node, true);
|
||||
return getTextOfNode(node, /*includeTrivia*/ true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6566,13 +6587,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
switch (compilerOptions.jsx) {
|
||||
case JsxEmit.React:
|
||||
write("\"");
|
||||
write(trimReactWhitespace(node));
|
||||
write(trimReactWhitespaceAndApplyEntities(node));
|
||||
write("\"");
|
||||
break;
|
||||
|
||||
case JsxEmit.Preserve:
|
||||
default: // Emit JSX-preserve as default when no --jsx flag is specified
|
||||
writer.writeLiteral(getTextOfNode(node, true));
|
||||
writer.writeLiteral(getTextOfNode(node, /*includeTrivia*/ true));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -7139,4 +7160,260 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var entities: Map<number> = {
|
||||
"quot": 0x0022,
|
||||
"amp": 0x0026,
|
||||
"apos": 0x0027,
|
||||
"lt": 0x003C,
|
||||
"gt": 0x003E,
|
||||
"nbsp": 0x00A0,
|
||||
"iexcl": 0x00A1,
|
||||
"cent": 0x00A2,
|
||||
"pound": 0x00A3,
|
||||
"curren": 0x00A4,
|
||||
"yen": 0x00A5,
|
||||
"brvbar": 0x00A6,
|
||||
"sect": 0x00A7,
|
||||
"uml": 0x00A8,
|
||||
"copy": 0x00A9,
|
||||
"ordf": 0x00AA,
|
||||
"laquo": 0x00AB,
|
||||
"not": 0x00AC,
|
||||
"shy": 0x00AD,
|
||||
"reg": 0x00AE,
|
||||
"macr": 0x00AF,
|
||||
"deg": 0x00B0,
|
||||
"plusmn": 0x00B1,
|
||||
"sup2": 0x00B2,
|
||||
"sup3": 0x00B3,
|
||||
"acute": 0x00B4,
|
||||
"micro": 0x00B5,
|
||||
"para": 0x00B6,
|
||||
"middot": 0x00B7,
|
||||
"cedil": 0x00B8,
|
||||
"sup1": 0x00B9,
|
||||
"ordm": 0x00BA,
|
||||
"raquo": 0x00BB,
|
||||
"frac14": 0x00BC,
|
||||
"frac12": 0x00BD,
|
||||
"frac34": 0x00BE,
|
||||
"iquest": 0x00BF,
|
||||
"Agrave": 0x00C0,
|
||||
"Aacute": 0x00C1,
|
||||
"Acirc": 0x00C2,
|
||||
"Atilde": 0x00C3,
|
||||
"Auml": 0x00C4,
|
||||
"Aring": 0x00C5,
|
||||
"AElig": 0x00C6,
|
||||
"Ccedil": 0x00C7,
|
||||
"Egrave": 0x00C8,
|
||||
"Eacute": 0x00C9,
|
||||
"Ecirc": 0x00CA,
|
||||
"Euml": 0x00CB,
|
||||
"Igrave": 0x00CC,
|
||||
"Iacute": 0x00CD,
|
||||
"Icirc": 0x00CE,
|
||||
"Iuml": 0x00CF,
|
||||
"ETH": 0x00D0,
|
||||
"Ntilde": 0x00D1,
|
||||
"Ograve": 0x00D2,
|
||||
"Oacute": 0x00D3,
|
||||
"Ocirc": 0x00D4,
|
||||
"Otilde": 0x00D5,
|
||||
"Ouml": 0x00D6,
|
||||
"times": 0x00D7,
|
||||
"Oslash": 0x00D8,
|
||||
"Ugrave": 0x00D9,
|
||||
"Uacute": 0x00DA,
|
||||
"Ucirc": 0x00DB,
|
||||
"Uuml": 0x00DC,
|
||||
"Yacute": 0x00DD,
|
||||
"THORN": 0x00DE,
|
||||
"szlig": 0x00DF,
|
||||
"agrave": 0x00E0,
|
||||
"aacute": 0x00E1,
|
||||
"acirc": 0x00E2,
|
||||
"atilde": 0x00E3,
|
||||
"auml": 0x00E4,
|
||||
"aring": 0x00E5,
|
||||
"aelig": 0x00E6,
|
||||
"ccedil": 0x00E7,
|
||||
"egrave": 0x00E8,
|
||||
"eacute": 0x00E9,
|
||||
"ecirc": 0x00EA,
|
||||
"euml": 0x00EB,
|
||||
"igrave": 0x00EC,
|
||||
"iacute": 0x00ED,
|
||||
"icirc": 0x00EE,
|
||||
"iuml": 0x00EF,
|
||||
"eth": 0x00F0,
|
||||
"ntilde": 0x00F1,
|
||||
"ograve": 0x00F2,
|
||||
"oacute": 0x00F3,
|
||||
"ocirc": 0x00F4,
|
||||
"otilde": 0x00F5,
|
||||
"ouml": 0x00F6,
|
||||
"divide": 0x00F7,
|
||||
"oslash": 0x00F8,
|
||||
"ugrave": 0x00F9,
|
||||
"uacute": 0x00FA,
|
||||
"ucirc": 0x00FB,
|
||||
"uuml": 0x00FC,
|
||||
"yacute": 0x00FD,
|
||||
"thorn": 0x00FE,
|
||||
"yuml": 0x00FF,
|
||||
"OElig": 0x0152,
|
||||
"oelig": 0x0153,
|
||||
"Scaron": 0x0160,
|
||||
"scaron": 0x0161,
|
||||
"Yuml": 0x0178,
|
||||
"fnof": 0x0192,
|
||||
"circ": 0x02C6,
|
||||
"tilde": 0x02DC,
|
||||
"Alpha": 0x0391,
|
||||
"Beta": 0x0392,
|
||||
"Gamma": 0x0393,
|
||||
"Delta": 0x0394,
|
||||
"Epsilon": 0x0395,
|
||||
"Zeta": 0x0396,
|
||||
"Eta": 0x0397,
|
||||
"Theta": 0x0398,
|
||||
"Iota": 0x0399,
|
||||
"Kappa": 0x039A,
|
||||
"Lambda": 0x039B,
|
||||
"Mu": 0x039C,
|
||||
"Nu": 0x039D,
|
||||
"Xi": 0x039E,
|
||||
"Omicron": 0x039F,
|
||||
"Pi": 0x03A0,
|
||||
"Rho": 0x03A1,
|
||||
"Sigma": 0x03A3,
|
||||
"Tau": 0x03A4,
|
||||
"Upsilon": 0x03A5,
|
||||
"Phi": 0x03A6,
|
||||
"Chi": 0x03A7,
|
||||
"Psi": 0x03A8,
|
||||
"Omega": 0x03A9,
|
||||
"alpha": 0x03B1,
|
||||
"beta": 0x03B2,
|
||||
"gamma": 0x03B3,
|
||||
"delta": 0x03B4,
|
||||
"epsilon": 0x03B5,
|
||||
"zeta": 0x03B6,
|
||||
"eta": 0x03B7,
|
||||
"theta": 0x03B8,
|
||||
"iota": 0x03B9,
|
||||
"kappa": 0x03BA,
|
||||
"lambda": 0x03BB,
|
||||
"mu": 0x03BC,
|
||||
"nu": 0x03BD,
|
||||
"xi": 0x03BE,
|
||||
"omicron": 0x03BF,
|
||||
"pi": 0x03C0,
|
||||
"rho": 0x03C1,
|
||||
"sigmaf": 0x03C2,
|
||||
"sigma": 0x03C3,
|
||||
"tau": 0x03C4,
|
||||
"upsilon": 0x03C5,
|
||||
"phi": 0x03C6,
|
||||
"chi": 0x03C7,
|
||||
"psi": 0x03C8,
|
||||
"omega": 0x03C9,
|
||||
"thetasym": 0x03D1,
|
||||
"upsih": 0x03D2,
|
||||
"piv": 0x03D6,
|
||||
"ensp": 0x2002,
|
||||
"emsp": 0x2003,
|
||||
"thinsp": 0x2009,
|
||||
"zwnj": 0x200C,
|
||||
"zwj": 0x200D,
|
||||
"lrm": 0x200E,
|
||||
"rlm": 0x200F,
|
||||
"ndash": 0x2013,
|
||||
"mdash": 0x2014,
|
||||
"lsquo": 0x2018,
|
||||
"rsquo": 0x2019,
|
||||
"sbquo": 0x201A,
|
||||
"ldquo": 0x201C,
|
||||
"rdquo": 0x201D,
|
||||
"bdquo": 0x201E,
|
||||
"dagger": 0x2020,
|
||||
"Dagger": 0x2021,
|
||||
"bull": 0x2022,
|
||||
"hellip": 0x2026,
|
||||
"permil": 0x2030,
|
||||
"prime": 0x2032,
|
||||
"Prime": 0x2033,
|
||||
"lsaquo": 0x2039,
|
||||
"rsaquo": 0x203A,
|
||||
"oline": 0x203E,
|
||||
"frasl": 0x2044,
|
||||
"euro": 0x20AC,
|
||||
"image": 0x2111,
|
||||
"weierp": 0x2118,
|
||||
"real": 0x211C,
|
||||
"trade": 0x2122,
|
||||
"alefsym": 0x2135,
|
||||
"larr": 0x2190,
|
||||
"uarr": 0x2191,
|
||||
"rarr": 0x2192,
|
||||
"darr": 0x2193,
|
||||
"harr": 0x2194,
|
||||
"crarr": 0x21B5,
|
||||
"lArr": 0x21D0,
|
||||
"uArr": 0x21D1,
|
||||
"rArr": 0x21D2,
|
||||
"dArr": 0x21D3,
|
||||
"hArr": 0x21D4,
|
||||
"forall": 0x2200,
|
||||
"part": 0x2202,
|
||||
"exist": 0x2203,
|
||||
"empty": 0x2205,
|
||||
"nabla": 0x2207,
|
||||
"isin": 0x2208,
|
||||
"notin": 0x2209,
|
||||
"ni": 0x220B,
|
||||
"prod": 0x220F,
|
||||
"sum": 0x2211,
|
||||
"minus": 0x2212,
|
||||
"lowast": 0x2217,
|
||||
"radic": 0x221A,
|
||||
"prop": 0x221D,
|
||||
"infin": 0x221E,
|
||||
"ang": 0x2220,
|
||||
"and": 0x2227,
|
||||
"or": 0x2228,
|
||||
"cap": 0x2229,
|
||||
"cup": 0x222A,
|
||||
"int": 0x222B,
|
||||
"there4": 0x2234,
|
||||
"sim": 0x223C,
|
||||
"cong": 0x2245,
|
||||
"asymp": 0x2248,
|
||||
"ne": 0x2260,
|
||||
"equiv": 0x2261,
|
||||
"le": 0x2264,
|
||||
"ge": 0x2265,
|
||||
"sub": 0x2282,
|
||||
"sup": 0x2283,
|
||||
"nsub": 0x2284,
|
||||
"sube": 0x2286,
|
||||
"supe": 0x2287,
|
||||
"oplus": 0x2295,
|
||||
"otimes": 0x2297,
|
||||
"perp": 0x22A5,
|
||||
"sdot": 0x22C5,
|
||||
"lceil": 0x2308,
|
||||
"rceil": 0x2309,
|
||||
"lfloor": 0x230A,
|
||||
"rfloor": 0x230B,
|
||||
"lang": 0x2329,
|
||||
"rang": 0x232A,
|
||||
"loz": 0x25CA,
|
||||
"spades": 0x2660,
|
||||
"clubs": 0x2663,
|
||||
"hearts": 0x2665,
|
||||
"diams": 0x2666
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5831,7 +5831,6 @@ namespace ts {
|
||||
|
||||
if (!name) {
|
||||
parseErrorAtPosition(pos, 0, Diagnostics.Identifier_expected);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let preName: Identifier, postName: Identifier;
|
||||
|
||||
+46
-38
@@ -360,19 +360,9 @@ namespace ts {
|
||||
|
||||
host = host || createCompilerHost(options);
|
||||
|
||||
// initialize resolveModuleNameWorker only if noResolve is false
|
||||
let resolveModuleNamesWorker: (moduleNames: string[], containingFile: string) => string[];
|
||||
if (!options.noResolve) {
|
||||
resolveModuleNamesWorker = host.resolveModuleNames;
|
||||
if (!resolveModuleNamesWorker) {
|
||||
resolveModuleNamesWorker = (moduleNames, containingFile) => {
|
||||
return map(moduleNames, moduleName => {
|
||||
let moduleResolution = resolveModuleName(moduleName, containingFile, options, host);
|
||||
return moduleResolution.resolvedFileName;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
const resolveModuleNamesWorker =
|
||||
host.resolveModuleNames ||
|
||||
((moduleNames, containingFile) => map(moduleNames, moduleName => resolveModuleName(moduleName, containingFile, options, host).resolvedFileName));
|
||||
|
||||
let filesByName = createFileMap<SourceFile>(fileName => host.getCanonicalFileName(fileName));
|
||||
|
||||
@@ -479,7 +469,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
// check imports
|
||||
collectExternalModuleReferences(newSourceFile);
|
||||
collectExternalModuleReferences(newSourceFile);
|
||||
if (!arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) {
|
||||
// imports has changed
|
||||
return false;
|
||||
@@ -562,7 +552,7 @@ namespace ts {
|
||||
// This is because in the -out scenario all files need to be emitted, and therefore all
|
||||
// files need to be type checked. And the way to specify that all files need to be type
|
||||
// checked is to not pass the file to getEmitResolver.
|
||||
let emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver(options.out ? undefined : sourceFile);
|
||||
let emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out)? undefined : sourceFile);
|
||||
|
||||
let start = new Date().getTime();
|
||||
|
||||
@@ -809,12 +799,15 @@ namespace ts {
|
||||
|
||||
// Set the source file for normalized absolute path
|
||||
filesByName.set(canonicalAbsolutePath, file);
|
||||
|
||||
|
||||
let basePath = getDirectoryPath(fileName);
|
||||
if (!options.noResolve) {
|
||||
let basePath = getDirectoryPath(fileName);
|
||||
processReferencedFiles(file, basePath);
|
||||
processImportedModules(file, basePath);
|
||||
}
|
||||
|
||||
// always process imported modules to record module name resolutions
|
||||
processImportedModules(file, basePath);
|
||||
|
||||
if (isDefaultLib) {
|
||||
file.isDefaultLib = true;
|
||||
files.unshift(file);
|
||||
@@ -852,21 +845,19 @@ namespace ts {
|
||||
});
|
||||
}
|
||||
|
||||
function processImportedModules(file: SourceFile, basePath: string) {
|
||||
collectExternalModuleReferences(file);
|
||||
if (file.imports.length) {
|
||||
function processImportedModules(file: SourceFile, basePath: string) {
|
||||
collectExternalModuleReferences(file);
|
||||
if (file.imports.length) {
|
||||
file.resolvedModules = {};
|
||||
let oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);
|
||||
|
||||
let moduleNames = map(file.imports, name => name.text);
|
||||
let resolutions = resolveModuleNamesWorker(moduleNames, file.fileName);
|
||||
for (let i = 0; i < file.imports.length; ++i) {
|
||||
let resolution = resolutions[i];
|
||||
setResolvedModuleName(file, moduleNames[i], resolution);
|
||||
if (resolution) {
|
||||
if (resolution && !options.noResolve) {
|
||||
findModuleSourceFile(resolution, file.imports[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// no imports - drop cached module resolutions
|
||||
@@ -942,27 +933,31 @@ namespace ts {
|
||||
function verifyCompilerOptions() {
|
||||
if (options.isolatedModules) {
|
||||
if (options.declaration) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_declaration_cannot_be_specified_with_option_isolatedModules));
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "declaration", "isolatedModules"));
|
||||
}
|
||||
|
||||
if (options.noEmitOnError) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_isolatedModules));
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmitOnError", "isolatedModules"));
|
||||
}
|
||||
|
||||
if (options.out) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_out_cannot_be_specified_with_option_isolatedModules));
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "isolatedModules"));
|
||||
}
|
||||
|
||||
if (options.outFile) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "outFile", "isolatedModules"));
|
||||
}
|
||||
}
|
||||
|
||||
if (options.inlineSourceMap) {
|
||||
if (options.sourceMap) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap));
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceMap", "inlineSourceMap"));
|
||||
}
|
||||
if (options.mapRoot) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap));
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap"));
|
||||
}
|
||||
if (options.sourceRoot) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap));
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceRoot", "inlineSourceMap"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -973,18 +968,23 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
if (options.out && options.outFile) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "outFile"));
|
||||
}
|
||||
|
||||
if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) {
|
||||
// Error to specify --mapRoot or --sourceRoot without mapSourceFiles
|
||||
if (options.mapRoot) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_mapRoot_cannot_be_specified_without_specifying_sourceMap_option));
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "mapRoot", "sourceMap"));
|
||||
}
|
||||
if (options.sourceRoot) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_sourceRoot_cannot_be_specified_without_specifying_sourceMap_option));
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "sourceRoot", "sourceMap"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
let languageVersion = options.target || ScriptTarget.ES3;
|
||||
let outFile = options.outFile || options.out;
|
||||
|
||||
let firstExternalModuleSourceFile = forEach(files, f => isExternalModule(f) ? f : undefined);
|
||||
if (options.isolatedModules) {
|
||||
@@ -1014,7 +1014,7 @@ namespace ts {
|
||||
if (options.outDir || // there is --outDir specified
|
||||
options.sourceRoot || // there is --sourceRoot specified
|
||||
(options.mapRoot && // there is --mapRoot specified and there would be multiple js files generated
|
||||
(!options.out || firstExternalModuleSourceFile !== undefined))) {
|
||||
(!outFile || firstExternalModuleSourceFile !== undefined))) {
|
||||
|
||||
if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) {
|
||||
// If a rootDir is specified and is valid use it as the commonSourceDirectory
|
||||
@@ -1034,18 +1034,26 @@ namespace ts {
|
||||
}
|
||||
|
||||
if (options.noEmit) {
|
||||
if (options.out || options.outDir) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_noEmit_cannot_be_specified_with_option_out_or_outDir));
|
||||
if (options.out) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmit", "out"));
|
||||
}
|
||||
|
||||
if (options.outFile) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmit", "outFile"));
|
||||
}
|
||||
|
||||
if (options.outDir) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmit", "outDir"));
|
||||
}
|
||||
|
||||
if (options.declaration) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_noEmit_cannot_be_specified_with_option_declaration));
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmit", "declaration"));
|
||||
}
|
||||
}
|
||||
|
||||
if (options.emitDecoratorMetadata &&
|
||||
!options.experimentalDecorators) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_experimentalDecorators_must_also_be_specified_when_option_emitDecoratorMetadata_is_specified));
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators"));
|
||||
}
|
||||
|
||||
if (options.experimentalAsyncFunctions &&
|
||||
|
||||
@@ -472,7 +472,7 @@ namespace ts {
|
||||
break;
|
||||
|
||||
case CharacterCodes.hash:
|
||||
if (isShebangTrivia(text, pos)) {
|
||||
if (pos === 0 && isShebangTrivia(text, pos)) {
|
||||
pos = scanShebangTrivia(text, pos);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1411,6 +1411,7 @@ namespace ts {
|
||||
/* @internal */ sourceMaps: SourceMapData[]; // Array of sourceMapData if compiler emitted sourcemaps
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export interface TypeCheckerHost {
|
||||
getCompilerOptions(): CompilerOptions;
|
||||
|
||||
@@ -2037,6 +2038,7 @@ namespace ts {
|
||||
noLib?: boolean;
|
||||
noResolve?: boolean;
|
||||
out?: string;
|
||||
outFile?: string;
|
||||
outDir?: string;
|
||||
preserveConstEnums?: boolean;
|
||||
project?: string;
|
||||
|
||||
@@ -240,7 +240,7 @@ namespace ts {
|
||||
// Make an identifier from an external module name by extracting the string after the last "/" and replacing
|
||||
// all non-alphanumeric characters with underscores
|
||||
export function makeIdentifierFromModuleName(moduleName: string): string {
|
||||
return getBaseFileName(moduleName).replace(/\W/g, "_");
|
||||
return getBaseFileName(moduleName).replace(/^(\d)/, "_$1").replace(/\W/g, "_");
|
||||
}
|
||||
|
||||
export function isBlockOrCatchScoped(declaration: Declaration) {
|
||||
@@ -420,7 +420,10 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function getJsDocComments(node: Node, sourceFileOfNode: SourceFile) {
|
||||
let commentRanges = (node.kind === SyntaxKind.Parameter || node.kind === SyntaxKind.TypeParameter) ?
concatenate(getTrailingCommentRanges(sourceFileOfNode.text, node.pos),
getLeadingCommentRanges(sourceFileOfNode.text, node.pos)) :
getLeadingCommentRangesOfNode(node, sourceFileOfNode);
|
||||
let commentRanges = (node.kind === SyntaxKind.Parameter || node.kind === SyntaxKind.TypeParameter) ?
|
||||
concatenate(getTrailingCommentRanges(sourceFileOfNode.text, node.pos),
|
||||
getLeadingCommentRanges(sourceFileOfNode.text, node.pos)) :
|
||||
getLeadingCommentRangesOfNode(node, sourceFileOfNode);
|
||||
return filter(commentRanges, isJsDocComment);
|
||||
|
||||
function isJsDocComment(comment: CommentRange) {
|
||||
@@ -638,6 +641,20 @@ namespace ts {
|
||||
return false;
|
||||
}
|
||||
|
||||
export function introducesArgumentsExoticObject(node: Node) {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
case SyntaxKind.MethodSignature:
|
||||
case SyntaxKind.Constructor:
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
case SyntaxKind.FunctionExpression:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isFunctionBlock(node: Node) {
|
||||
return node && node.kind === SyntaxKind.Block && isFunctionLike(node.parent);
|
||||
}
|
||||
@@ -961,6 +978,7 @@ namespace ts {
|
||||
case SyntaxKind.ComputedPropertyName:
|
||||
return node === (<ComputedPropertyName>parent).expression;
|
||||
case SyntaxKind.Decorator:
|
||||
case SyntaxKind.JsxExpression:
|
||||
return true;
|
||||
case SyntaxKind.ExpressionWithTypeArguments:
|
||||
return (<ExpressionWithTypeArguments>parent).expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
||||
@@ -1749,7 +1767,7 @@ namespace ts {
|
||||
|
||||
export function shouldEmitToOwnFile(sourceFile: SourceFile, compilerOptions: CompilerOptions): boolean {
|
||||
if (!isDeclarationFile(sourceFile)) {
|
||||
if ((isExternalModule(sourceFile) || !compilerOptions.out)) {
|
||||
if ((isExternalModule(sourceFile) || !(compilerOptions.outFile || compilerOptions.out))) {
|
||||
// 1. in-browser single file compilation scenario
|
||||
// 2. non .js file
|
||||
return compilerOptions.isolatedModules || !fileExtensionIs(sourceFile.fileName, ".js");
|
||||
|
||||
+36
-17
@@ -123,18 +123,20 @@ module FourSlash {
|
||||
mapRoot: "mapRoot",
|
||||
module: "module",
|
||||
out: "out",
|
||||
outFile: "outFile",
|
||||
outDir: "outDir",
|
||||
sourceMap: "sourceMap",
|
||||
sourceRoot: "sourceRoot",
|
||||
allowNonTsExtensions: "allowNonTsExtensions",
|
||||
resolveReference: "ResolveReference", // This flag is used to specify entry file for resolve file references. The flag is only allow once per test file
|
||||
jsx: "jsx",
|
||||
};
|
||||
|
||||
// List of allowed metadata names
|
||||
let fileMetadataNames = [metadataOptionNames.fileName, metadataOptionNames.emitThisFile, metadataOptionNames.resolveReference];
|
||||
let globalMetadataNames = [metadataOptionNames.allowNonTsExtensions, metadataOptionNames.baselineFile, metadataOptionNames.declaration,
|
||||
metadataOptionNames.mapRoot, metadataOptionNames.module, metadataOptionNames.out,
|
||||
metadataOptionNames.outDir, metadataOptionNames.sourceMap, metadataOptionNames.sourceRoot];
|
||||
metadataOptionNames.mapRoot, metadataOptionNames.module, metadataOptionNames.out,metadataOptionNames.outFile,
|
||||
metadataOptionNames.outDir, metadataOptionNames.sourceMap, metadataOptionNames.sourceRoot, metadataOptionNames.jsx];
|
||||
|
||||
function convertGlobalOptionsToCompilerOptions(globalOptions: { [idx: string]: string }): ts.CompilerOptions {
|
||||
let settings: ts.CompilerOptions = { target: ts.ScriptTarget.ES5 };
|
||||
@@ -169,6 +171,9 @@ module FourSlash {
|
||||
case metadataOptionNames.out:
|
||||
settings.out = globalOptions[prop];
|
||||
break;
|
||||
case metadataOptionNames.outFile:
|
||||
settings.outFile = globalOptions[prop];
|
||||
break;
|
||||
case metadataOptionNames.outDir:
|
||||
settings.outDir = globalOptions[prop];
|
||||
break;
|
||||
@@ -178,6 +183,20 @@ module FourSlash {
|
||||
case metadataOptionNames.sourceRoot:
|
||||
settings.sourceRoot = globalOptions[prop];
|
||||
break;
|
||||
case metadataOptionNames.jsx:
|
||||
switch (globalOptions[prop].toLowerCase()) {
|
||||
case "react":
|
||||
settings.jsx = ts.JsxEmit.React;
|
||||
break;
|
||||
case "preserve":
|
||||
settings.jsx = ts.JsxEmit.Preserve;
|
||||
break;
|
||||
default:
|
||||
ts.Debug.assert(globalOptions[prop] === undefined || globalOptions[prop] === "None");
|
||||
settings.jsx = ts.JsxEmit.None;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -358,7 +377,7 @@ module FourSlash {
|
||||
this.formatCodeOptions = {
|
||||
IndentSize: 4,
|
||||
TabSize: 4,
|
||||
NewLineCharacter: ts.sys.newLine,
|
||||
NewLineCharacter: Harness.IO.newLine(),
|
||||
ConvertTabsToSpaces: true,
|
||||
InsertSpaceAfterCommaDelimiter: true,
|
||||
InsertSpaceAfterSemicolonInForStatements: true,
|
||||
@@ -536,7 +555,7 @@ module FourSlash {
|
||||
errors.forEach(function (error: ts.Diagnostic) {
|
||||
Harness.IO.log(" minChar: " + error.start +
|
||||
", limChar: " + (error.start + error.length) +
|
||||
", message: " + ts.flattenDiagnosticMessageText(error.messageText, ts.sys.newLine) + "\n");
|
||||
", message: " + ts.flattenDiagnosticMessageText(error.messageText, Harness.IO.newLine()) + "\n");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1247,21 +1266,21 @@ module FourSlash {
|
||||
emitFiles.forEach(emitFile => {
|
||||
let emitOutput = this.languageService.getEmitOutput(emitFile.fileName);
|
||||
// Print emitOutputStatus in readable format
|
||||
resultString += "EmitSkipped: " + emitOutput.emitSkipped + ts.sys.newLine;
|
||||
resultString += "EmitSkipped: " + emitOutput.emitSkipped + Harness.IO.newLine();
|
||||
|
||||
if (emitOutput.emitSkipped) {
|
||||
resultString += "Diagnostics:" + ts.sys.newLine;
|
||||
resultString += "Diagnostics:" + Harness.IO.newLine();
|
||||
let diagnostics = ts.getPreEmitDiagnostics(this.languageService.getProgram());
|
||||
for (let i = 0, n = diagnostics.length; i < n; i++) {
|
||||
resultString += " " + diagnostics[0].messageText + ts.sys.newLine;
|
||||
resultString += " " + diagnostics[0].messageText + Harness.IO.newLine();
|
||||
}
|
||||
}
|
||||
|
||||
emitOutput.outputFiles.forEach((outputFile, idx, array) => {
|
||||
let fileName = "FileName : " + outputFile.name + ts.sys.newLine;
|
||||
let fileName = "FileName : " + outputFile.name + Harness.IO.newLine();
|
||||
resultString = resultString + fileName + outputFile.text;
|
||||
});
|
||||
resultString += ts.sys.newLine;
|
||||
resultString += Harness.IO.newLine();
|
||||
});
|
||||
|
||||
return resultString;
|
||||
@@ -1298,7 +1317,7 @@ module FourSlash {
|
||||
Harness.IO.log(
|
||||
"start: " + err.start +
|
||||
", length: " + err.length +
|
||||
", message: " + ts.flattenDiagnosticMessageText(err.messageText, ts.sys.newLine));
|
||||
", message: " + ts.flattenDiagnosticMessageText(err.messageText, Harness.IO.newLine()));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1872,9 +1891,9 @@ module FourSlash {
|
||||
}
|
||||
|
||||
function jsonMismatchString() {
|
||||
return ts.sys.newLine +
|
||||
"expected: '" + ts.sys.newLine + JSON.stringify(expected, (k, v) => v, 2) + "'" + ts.sys.newLine +
|
||||
"actual: '" + ts.sys.newLine + JSON.stringify(actual, (k, v) => v, 2) + "'";
|
||||
return Harness.IO.newLine() +
|
||||
"expected: '" + Harness.IO.newLine() + JSON.stringify(expected, (k, v) => v, 2) + "'" + Harness.IO.newLine() +
|
||||
"actual: '" + Harness.IO.newLine() + JSON.stringify(actual, (k, v) => v, 2) + "'";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2383,7 +2402,7 @@ module FourSlash {
|
||||
let host = Harness.Compiler.createCompilerHost([{ unitName: Harness.Compiler.fourslashFileName, content: undefined }],
|
||||
(fn, contents) => fourslashJsOutput = contents,
|
||||
ts.ScriptTarget.Latest,
|
||||
ts.sys.useCaseSensitiveFileNames);
|
||||
Harness.IO.useCaseSensitiveFileNames());
|
||||
|
||||
let program = ts.createProgram([Harness.Compiler.fourslashFileName], { noResolve: true, target: ts.ScriptTarget.ES3 }, host);
|
||||
|
||||
@@ -2405,16 +2424,16 @@ module FourSlash {
|
||||
],
|
||||
(fn, contents) => result = contents,
|
||||
ts.ScriptTarget.Latest,
|
||||
ts.sys.useCaseSensitiveFileNames);
|
||||
Harness.IO.useCaseSensitiveFileNames());
|
||||
|
||||
let program = ts.createProgram([Harness.Compiler.fourslashFileName, fileName], { out: "fourslashTestOutput.js", noResolve: true, target: ts.ScriptTarget.ES3 }, host);
|
||||
let program = ts.createProgram([Harness.Compiler.fourslashFileName, fileName], { outFile: "fourslashTestOutput.js", noResolve: true, target: ts.ScriptTarget.ES3 }, host);
|
||||
|
||||
let sourceFile = host.getSourceFile(fileName, ts.ScriptTarget.ES3);
|
||||
|
||||
let diagnostics = ts.getPreEmitDiagnostics(program, sourceFile);
|
||||
if (diagnostics.length > 0) {
|
||||
throw new Error(`Error compiling ${fileName}: ` +
|
||||
diagnostics.map(e => ts.flattenDiagnosticMessageText(e.messageText, ts.sys.newLine)).join("\r\n"));
|
||||
diagnostics.map(e => ts.flattenDiagnosticMessageText(e.messageText, Harness.IO.newLine())).join("\r\n"));
|
||||
}
|
||||
|
||||
program.emit(sourceFile);
|
||||
|
||||
+62
-33
@@ -26,7 +26,6 @@
|
||||
|
||||
// Block scoped definitions work poorly for global variables, temporarily enable var
|
||||
/* tslint:disable:no-var-keyword */
|
||||
var Buffer: BufferConstructor = require("buffer").Buffer;
|
||||
|
||||
// this will work in the browser via browserify
|
||||
var _chai: typeof chai = require("chai");
|
||||
@@ -55,9 +54,17 @@ module Utils {
|
||||
return ExecutionEnvironment.Node;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export let currentExecutionEnvironment = getExecutionEnvironment();
|
||||
|
||||
const Buffer: BufferConstructor = currentExecutionEnvironment !== ExecutionEnvironment.Browser
|
||||
? require("buffer").Buffer
|
||||
: undefined;
|
||||
|
||||
export function encodeString(s: string): string {
|
||||
return Buffer ? (new Buffer(s)).toString("utf8") : s;
|
||||
}
|
||||
|
||||
export function evalFile(fileContents: string, fileName: string, nodeContext?: any) {
|
||||
let environment = getExecutionEnvironment();
|
||||
switch (environment) {
|
||||
@@ -102,7 +109,7 @@ module Utils {
|
||||
|
||||
let content: string = undefined;
|
||||
try {
|
||||
content = ts.sys.readFile(Harness.userSpecifiedRoot + path);
|
||||
content = Harness.IO.readFile(Harness.userSpecifiedRoot + path);
|
||||
}
|
||||
catch (err) {
|
||||
return undefined;
|
||||
@@ -190,7 +197,7 @@ module Utils {
|
||||
return {
|
||||
start: diagnostic.start,
|
||||
length: diagnostic.length,
|
||||
messageText: ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine),
|
||||
messageText: ts.flattenDiagnosticMessageText(diagnostic.messageText, Harness.IO.newLine()),
|
||||
category: (<any>ts).DiagnosticCategory[diagnostic.category],
|
||||
code: diagnostic.code
|
||||
};
|
||||
@@ -323,8 +330,8 @@ module Utils {
|
||||
assert.equal(d1.start, d2.start, "d1.start !== d2.start");
|
||||
assert.equal(d1.length, d2.length, "d1.length !== d2.length");
|
||||
assert.equal(
|
||||
ts.flattenDiagnosticMessageText(d1.messageText, ts.sys.newLine),
|
||||
ts.flattenDiagnosticMessageText(d2.messageText, ts.sys.newLine), "d1.messageText !== d2.messageText");
|
||||
ts.flattenDiagnosticMessageText(d1.messageText, Harness.IO.newLine()),
|
||||
ts.flattenDiagnosticMessageText(d2.messageText, Harness.IO.newLine()), "d1.messageText !== d2.messageText");
|
||||
assert.equal(d1.category, d2.category, "d1.category !== d2.category");
|
||||
assert.equal(d1.code, d2.code, "d1.code !== d2.code");
|
||||
}
|
||||
@@ -404,6 +411,10 @@ module Harness.Path {
|
||||
|
||||
module Harness {
|
||||
export interface IO {
|
||||
newLine(): string;
|
||||
getCurrentDirectory(): string;
|
||||
useCaseSensitiveFileNames(): boolean;
|
||||
resolvePath(path: string): string;
|
||||
readFile(path: string): string;
|
||||
writeFile(path: string, contents: string): void;
|
||||
directoryName(path: string): string;
|
||||
@@ -416,7 +427,10 @@ module Harness {
|
||||
getMemoryUsage?(): number;
|
||||
}
|
||||
export var IO: IO;
|
||||
|
||||
|
||||
// harness always uses one kind of new line
|
||||
const harnessNewLine = "\r\n";
|
||||
|
||||
module IOImpl {
|
||||
declare class Enumerator {
|
||||
public atEnd(): boolean;
|
||||
@@ -433,12 +447,17 @@ module Harness {
|
||||
fso = {};
|
||||
}
|
||||
|
||||
export let readFile: typeof IO.readFile = ts.sys.readFile;
|
||||
export let writeFile: typeof IO.writeFile = ts.sys.writeFile;
|
||||
export let directoryName: typeof IO.directoryName = fso.GetParentFolderName;
|
||||
export let directoryExists: typeof IO.directoryExists = fso.FolderExists;
|
||||
export let fileExists: typeof IO.fileExists = fso.FileExists;
|
||||
export let log: typeof IO.log = global.WScript && global.WScript.StdOut.WriteLine;
|
||||
export const resolvePath = (path: string) => ts.sys.resolvePath(path);
|
||||
export const getCurrentDirectory = () => ts.sys.getCurrentDirectory();
|
||||
export const newLine = () => harnessNewLine;
|
||||
export const useCaseSensitiveFileNames = () => ts.sys.useCaseSensitiveFileNames;
|
||||
|
||||
export const readFile: typeof IO.readFile = path => ts.sys.readFile(path);
|
||||
export const writeFile: typeof IO.writeFile = (path, content) => ts.sys.writeFile(path, content);
|
||||
export const directoryName: typeof IO.directoryName = fso.GetParentFolderName;
|
||||
export const directoryExists: typeof IO.directoryExists = fso.FolderExists;
|
||||
export const fileExists: typeof IO.fileExists = fso.FileExists;
|
||||
export const log: typeof IO.log = global.WScript && global.WScript.StdOut.WriteLine;
|
||||
|
||||
export function createDirectory(path: string) {
|
||||
if (directoryExists(path)) {
|
||||
@@ -493,11 +512,16 @@ module Harness {
|
||||
} else {
|
||||
fs = pathModule = {};
|
||||
}
|
||||
|
||||
export const resolvePath = (path: string) => ts.sys.resolvePath(path);
|
||||
export const getCurrentDirectory = () => ts.sys.getCurrentDirectory();
|
||||
export const newLine = () => harnessNewLine;
|
||||
export const useCaseSensitiveFileNames = () => ts.sys.useCaseSensitiveFileNames;
|
||||
|
||||
export let readFile: typeof IO.readFile = ts.sys.readFile;
|
||||
export let writeFile: typeof IO.writeFile = ts.sys.writeFile;
|
||||
export let fileExists: typeof IO.fileExists = fs.existsSync;
|
||||
export let log: typeof IO.log = s => console.log(s);
|
||||
export const readFile: typeof IO.readFile = path => ts.sys.readFile(path);
|
||||
export const writeFile: typeof IO.writeFile = (path, content) => ts.sys.writeFile(path, content);
|
||||
export const fileExists: typeof IO.fileExists = fs.existsSync;
|
||||
export const log: typeof IO.log = s => console.log(s);
|
||||
|
||||
export function createDirectory(path: string) {
|
||||
if (!directoryExists(path)) {
|
||||
@@ -562,9 +586,9 @@ module Harness {
|
||||
export module Network {
|
||||
let serverRoot = "http://localhost:8888/";
|
||||
|
||||
// Unused?
|
||||
let newLine = "\r\n";
|
||||
let currentDirectory = () => "";
|
||||
export const newLine = () => harnessNewLine;
|
||||
export const useCaseSensitiveFileNames = () => false;
|
||||
export const getCurrentDirectory = () => "";
|
||||
let supportsCodePage = () => false;
|
||||
|
||||
module Http {
|
||||
@@ -616,6 +640,7 @@ module Harness {
|
||||
xhr.send(contents);
|
||||
}
|
||||
catch (e) {
|
||||
log(`XHR Error: ${e}`);
|
||||
return { status: 500, responseText: null };
|
||||
}
|
||||
|
||||
@@ -655,6 +680,7 @@ module Harness {
|
||||
return dirPath;
|
||||
}
|
||||
export let directoryName: typeof IO.directoryName = Utils.memoize(directoryNameImpl);
|
||||
export const resolvePath = (path: string) => directoryName(path);
|
||||
|
||||
export function fileExists(path: string): boolean {
|
||||
let response = Http.getFileFromServerSync(serverRoot + path);
|
||||
@@ -840,7 +866,7 @@ module Harness {
|
||||
export let fourslashSourceFile: ts.SourceFile;
|
||||
|
||||
export function getCanonicalFileName(fileName: string): string {
|
||||
return ts.sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase();
|
||||
return Harness.IO.useCaseSensitiveFileNames() ? fileName : fileName.toLowerCase();
|
||||
}
|
||||
|
||||
export function createCompilerHost(
|
||||
@@ -858,7 +884,7 @@ module Harness {
|
||||
}
|
||||
|
||||
let filemap: { [fileName: string]: ts.SourceFile; } = {};
|
||||
let getCurrentDirectory = currentDirectory === undefined ? ts.sys.getCurrentDirectory : () => currentDirectory;
|
||||
let getCurrentDirectory = currentDirectory === undefined ? Harness.IO.getCurrentDirectory : () => currentDirectory;
|
||||
|
||||
// Register input files
|
||||
function register(file: { unitName: string; content: string; }) {
|
||||
@@ -895,7 +921,7 @@ module Harness {
|
||||
let newLine =
|
||||
newLineKind === ts.NewLineKind.CarriageReturnLineFeed ? carriageReturnLineFeed :
|
||||
newLineKind === ts.NewLineKind.LineFeed ? lineFeed :
|
||||
ts.sys.newLine;
|
||||
Harness.IO.newLine();
|
||||
|
||||
return {
|
||||
getCurrentDirectory,
|
||||
@@ -988,7 +1014,7 @@ module Harness {
|
||||
// Treat them as library files, so include them in build, but not in baselines.
|
||||
let includeBuiltFiles: { unitName: string; content: string }[] = [];
|
||||
|
||||
let useCaseSensitiveFileNames = ts.sys.useCaseSensitiveFileNames;
|
||||
let useCaseSensitiveFileNames = Harness.IO.useCaseSensitiveFileNames();
|
||||
this.settings.forEach(setCompilerOptionForSetting);
|
||||
|
||||
let fileOutputs: GeneratedFile[] = [];
|
||||
@@ -1006,11 +1032,9 @@ module Harness {
|
||||
let errors = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
|
||||
this.lastErrors = errors;
|
||||
|
||||
let result = new CompilerResult(fileOutputs, errors, program, ts.sys.getCurrentDirectory(), emitResult.sourceMaps);
|
||||
let result = new CompilerResult(fileOutputs, errors, program, Harness.IO.getCurrentDirectory(), emitResult.sourceMaps);
|
||||
onComplete(result, program);
|
||||
|
||||
// reset what newline means in case the last test changed it
|
||||
ts.sys.newLine = newLine;
|
||||
return options;
|
||||
|
||||
function setCompilerOptionForSetting(setting: Harness.TestCaseParser.CompilerSetting) {
|
||||
@@ -1107,6 +1131,10 @@ module Harness {
|
||||
options.out = setting.value;
|
||||
break;
|
||||
|
||||
case "outfile":
|
||||
options.outFile = setting.value;
|
||||
break;
|
||||
|
||||
case "outdiroption":
|
||||
case "outdir":
|
||||
options.outDir = setting.value;
|
||||
@@ -1245,7 +1273,8 @@ module Harness {
|
||||
assert(sourceFile, "Program has no source file with name '" + fileName + "'");
|
||||
// Is this file going to be emitted separately
|
||||
let sourceFileName: string;
|
||||
if (ts.isExternalModule(sourceFile) || !options.out) {
|
||||
let outFile = options.outFile || options.out;
|
||||
if (ts.isExternalModule(sourceFile) || !outFile) {
|
||||
if (options.outDir) {
|
||||
let sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, result.currentDirectoryForProgram);
|
||||
sourceFilePath = sourceFilePath.replace(result.program.getCommonSourceDirectory(), "");
|
||||
@@ -1257,7 +1286,7 @@ module Harness {
|
||||
}
|
||||
else {
|
||||
// Goes to single --out file
|
||||
sourceFileName = options.out;
|
||||
sourceFileName = outFile;
|
||||
}
|
||||
|
||||
let dTsFileName = ts.removeFileExtension(sourceFileName) + ".d.ts";
|
||||
@@ -1289,7 +1318,7 @@ module Harness {
|
||||
errorOutput += diagnostic.file.fileName + "(" + (lineAndCharacter.line + 1) + "," + (lineAndCharacter.character + 1) + "): ";
|
||||
}
|
||||
|
||||
errorOutput += ts.DiagnosticCategory[diagnostic.category].toLowerCase() + " TS" + diagnostic.code + ": " + ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine) + ts.sys.newLine;
|
||||
errorOutput += ts.DiagnosticCategory[diagnostic.category].toLowerCase() + " TS" + diagnostic.code + ": " + ts.flattenDiagnosticMessageText(diagnostic.messageText, Harness.IO.newLine()) + Harness.IO.newLine();
|
||||
});
|
||||
|
||||
return errorOutput;
|
||||
@@ -1302,7 +1331,7 @@ module Harness {
|
||||
let totalErrorsReported = 0;
|
||||
|
||||
function outputErrorText(error: ts.Diagnostic) {
|
||||
let message = ts.flattenDiagnosticMessageText(error.messageText, ts.sys.newLine);
|
||||
let message = ts.flattenDiagnosticMessageText(error.messageText, Harness.IO.newLine());
|
||||
|
||||
let errLines = RunnerBase.removeFullPaths(message)
|
||||
.split("\n")
|
||||
@@ -1399,7 +1428,7 @@ module Harness {
|
||||
assert.equal(totalErrorsReported + numLibraryDiagnostics + numTest262HarnessDiagnostics, diagnostics.length, "total number of errors");
|
||||
|
||||
return minimalDiagnosticsToString(diagnostics) +
|
||||
ts.sys.newLine + ts.sys.newLine + outputLines.join("\r\n");
|
||||
Harness.IO.newLine() + Harness.IO.newLine() + outputLines.join("\r\n");
|
||||
}
|
||||
|
||||
export function collateOutputs(outputFiles: Harness.Compiler.GeneratedFile[]): string {
|
||||
@@ -1735,7 +1764,7 @@ module Harness {
|
||||
}
|
||||
|
||||
function writeComparison(expected: string, actual: string, relativeFileName: string, actualFileName: string, descriptionForDescribe: string) {
|
||||
let encoded_actual = (new Buffer(actual)).toString("utf8");
|
||||
let encoded_actual = Utils.encodeString(actual);
|
||||
if (expected != encoded_actual) {
|
||||
// Overwrite & issue error
|
||||
let errMsg = "The baseline file " + relativeFileName + " has changed";
|
||||
|
||||
@@ -62,7 +62,7 @@ class ProjectRunner extends RunnerBase {
|
||||
|
||||
let testFileText: string = null;
|
||||
try {
|
||||
testFileText = ts.sys.readFile(testCaseFileName);
|
||||
testFileText = Harness.IO.readFile(testCaseFileName);
|
||||
}
|
||||
catch (e) {
|
||||
assert(false, "Unable to open testcase file: " + testCaseFileName + ": " + e.message);
|
||||
@@ -98,7 +98,7 @@ class ProjectRunner extends RunnerBase {
|
||||
}
|
||||
|
||||
function cleanProjectUrl(url: string) {
|
||||
let diskProjectPath = ts.normalizeSlashes(ts.sys.resolvePath(testCase.projectRoot));
|
||||
let diskProjectPath = ts.normalizeSlashes(Harness.IO.resolvePath(testCase.projectRoot));
|
||||
let projectRootUrl = "file:///" + diskProjectPath;
|
||||
let normalizedProjectRoot = ts.normalizeSlashes(testCase.projectRoot);
|
||||
diskProjectPath = diskProjectPath.substr(0, diskProjectPath.lastIndexOf(normalizedProjectRoot));
|
||||
@@ -122,7 +122,7 @@ class ProjectRunner extends RunnerBase {
|
||||
}
|
||||
|
||||
function getCurrentDirectory() {
|
||||
return ts.sys.resolvePath(testCase.projectRoot);
|
||||
return Harness.IO.resolvePath(testCase.projectRoot);
|
||||
}
|
||||
|
||||
function compileProjectFiles(moduleKind: ts.ModuleKind, getInputFiles: () => string[],
|
||||
@@ -158,10 +158,10 @@ class ProjectRunner extends RunnerBase {
|
||||
return {
|
||||
declaration: !!testCase.declaration,
|
||||
sourceMap: !!testCase.sourceMap,
|
||||
out: testCase.out,
|
||||
outFile: testCase.out,
|
||||
outDir: testCase.outDir,
|
||||
mapRoot: testCase.resolveMapRoot && testCase.mapRoot ? ts.sys.resolvePath(testCase.mapRoot) : testCase.mapRoot,
|
||||
sourceRoot: testCase.resolveSourceRoot && testCase.sourceRoot ? ts.sys.resolvePath(testCase.sourceRoot) : testCase.sourceRoot,
|
||||
mapRoot: testCase.resolveMapRoot && testCase.mapRoot ? Harness.IO.resolvePath(testCase.mapRoot) : testCase.mapRoot,
|
||||
sourceRoot: testCase.resolveSourceRoot && testCase.sourceRoot ? Harness.IO.resolvePath(testCase.sourceRoot) : testCase.sourceRoot,
|
||||
module: moduleKind,
|
||||
moduleResolution: ts.ModuleResolutionKind.Classic, // currently all tests use classic module resolution kind, this will change in the future
|
||||
noResolve: testCase.noResolve,
|
||||
@@ -191,8 +191,8 @@ class ProjectRunner extends RunnerBase {
|
||||
writeFile,
|
||||
getCurrentDirectory,
|
||||
getCanonicalFileName: Harness.Compiler.getCanonicalFileName,
|
||||
useCaseSensitiveFileNames: () => ts.sys.useCaseSensitiveFileNames,
|
||||
getNewLine: () => ts.sys.newLine,
|
||||
useCaseSensitiveFileNames: () => Harness.IO.useCaseSensitiveFileNames(),
|
||||
getNewLine: () => Harness.IO.newLine(),
|
||||
fileExists: fileName => getSourceFile(fileName, ts.ScriptTarget.ES5) !== undefined,
|
||||
readFile: fileName => Harness.IO.readFile(fileName)
|
||||
};
|
||||
@@ -217,7 +217,7 @@ class ProjectRunner extends RunnerBase {
|
||||
function getSourceFileText(fileName: string): string {
|
||||
let text: string = undefined;
|
||||
try {
|
||||
text = ts.sys.readFile(ts.isRootedDiskPath(fileName)
|
||||
text = Harness.IO.readFile(ts.isRootedDiskPath(fileName)
|
||||
? fileName
|
||||
: ts.normalizeSlashes(testCase.projectRoot) + "/" + ts.normalizeSlashes(fileName));
|
||||
}
|
||||
@@ -264,14 +264,14 @@ class ProjectRunner extends RunnerBase {
|
||||
// Actual writing of file as in tc.ts
|
||||
function ensureDirectoryStructure(directoryname: string) {
|
||||
if (directoryname) {
|
||||
if (!ts.sys.directoryExists(directoryname)) {
|
||||
if (!Harness.IO.directoryExists(directoryname)) {
|
||||
ensureDirectoryStructure(ts.getDirectoryPath(directoryname));
|
||||
ts.sys.createDirectory(directoryname);
|
||||
Harness.IO.createDirectory(directoryname);
|
||||
}
|
||||
}
|
||||
}
|
||||
ensureDirectoryStructure(ts.getDirectoryPath(ts.normalizePath(outputFilePath)));
|
||||
ts.sys.writeFile(outputFilePath, data, writeByteOrderMark);
|
||||
Harness.IO.writeFile(outputFilePath, data);
|
||||
|
||||
outputFiles.push({ emittedFileName: fileName, code: data, fileName: diskRelativeName, writeByteOrderMark: writeByteOrderMark });
|
||||
}
|
||||
@@ -300,7 +300,7 @@ class ProjectRunner extends RunnerBase {
|
||||
allInputFiles.unshift(findOutpuDtsFile(outputDtsFileName));
|
||||
}
|
||||
else {
|
||||
let outputDtsFileName = ts.removeFileExtension(compilerOptions.out) + ".d.ts";
|
||||
let outputDtsFileName = ts.removeFileExtension(compilerOptions.outFile|| compilerOptions.out) + ".d.ts";
|
||||
let outputDtsFile = findOutpuDtsFile(outputDtsFileName);
|
||||
if (!ts.contains(allInputFiles, outputDtsFile)) {
|
||||
allInputFiles.unshift(outputDtsFile);
|
||||
@@ -392,7 +392,7 @@ class ProjectRunner extends RunnerBase {
|
||||
|
||||
Harness.Baseline.runBaseline("Baseline of emitted result (" + moduleNameToString(compilerResult.moduleKind) + "): " + testCaseFileName, getBaselineFolder(compilerResult.moduleKind) + outputFile.fileName, () => {
|
||||
try {
|
||||
return ts.sys.readFile(getProjectOutputFolder(outputFile.fileName, compilerResult.moduleKind));
|
||||
return Harness.IO.readFile(getProjectOutputFolder(outputFile.fileName, compilerResult.moduleKind));
|
||||
}
|
||||
catch (e) {
|
||||
return undefined;
|
||||
|
||||
@@ -106,6 +106,4 @@ if (runners.length === 0) {
|
||||
// runners.push(new GeneratedFourslashRunner());
|
||||
}
|
||||
|
||||
ts.sys.newLine = "\r\n";
|
||||
|
||||
runTests(runners);
|
||||
|
||||
Vendored
+2650
-9
File diff suppressed because it is too large
Load Diff
Vendored
+1
-1
@@ -8,4 +8,4 @@ interface NodeList {
|
||||
|
||||
interface NodeListOf<TNode extends Node> {
|
||||
[Symbol.iterator](): IterableIterator<TNode>
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+20
-11
@@ -2459,7 +2459,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
|
||||
* @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;
|
||||
open(url?: string, name?: string, features?: string, replace?: boolean): Document;
|
||||
/**
|
||||
* 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.
|
||||
@@ -2916,6 +2916,7 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec
|
||||
webkitMatchesSelector(selectors: string): boolean;
|
||||
webkitRequestFullScreen(): void;
|
||||
webkitRequestFullscreen(): void;
|
||||
getElementsByClassName(classNames: string): NodeListOf<Element>;
|
||||
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;
|
||||
@@ -3030,7 +3031,7 @@ interface File extends Blob {
|
||||
|
||||
declare var File: {
|
||||
prototype: File;
|
||||
new(): File;
|
||||
new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File;
|
||||
}
|
||||
|
||||
interface FileList {
|
||||
@@ -3903,7 +3904,6 @@ interface HTMLElement extends Element {
|
||||
contains(child: HTMLElement): boolean;
|
||||
dragDrop(): boolean;
|
||||
focus(): void;
|
||||
getElementsByClassName(classNames: string): NodeListOf<Element>;
|
||||
insertAdjacentElement(position: string, insertedElement: Element): Element;
|
||||
insertAdjacentHTML(where: string, html: string): void;
|
||||
insertAdjacentText(where: string, text: string): void;
|
||||
@@ -6865,7 +6865,7 @@ interface IDBDatabase extends EventTarget {
|
||||
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: "abort", 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;
|
||||
}
|
||||
@@ -6986,7 +6986,7 @@ interface IDBTransaction extends EventTarget {
|
||||
READ_ONLY: string;
|
||||
READ_WRITE: string;
|
||||
VERSION_CHANGE: string;
|
||||
addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: "abort", listener: (ev: Event) => 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;
|
||||
@@ -7016,11 +7016,14 @@ interface ImageData {
|
||||
width: number;
|
||||
}
|
||||
|
||||
declare var ImageData: {
|
||||
interface ImageDataConstructor {
|
||||
prototype: ImageData;
|
||||
new(): ImageData;
|
||||
new(width: number, height: number): ImageData;
|
||||
new(array: Uint8ClampedArray, width: number, height: number): ImageData;
|
||||
}
|
||||
|
||||
declare var ImageData: ImageDataConstructor;
|
||||
|
||||
interface KeyboardEvent extends UIEvent {
|
||||
altKey: boolean;
|
||||
char: string;
|
||||
@@ -12169,7 +12172,7 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget {
|
||||
LOADING: number;
|
||||
OPENED: number;
|
||||
UNSENT: number;
|
||||
addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: "abort", listener: (ev: Event) => 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;
|
||||
@@ -12439,7 +12442,7 @@ interface MSBaseReader {
|
||||
DONE: number;
|
||||
EMPTY: number;
|
||||
LOADING: number;
|
||||
addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: "abort", listener: (ev: Event) => 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;
|
||||
@@ -12595,7 +12598,7 @@ interface XMLHttpRequestEventTarget {
|
||||
onloadstart: (ev: Event) => any;
|
||||
onprogress: (ev: ProgressEvent) => any;
|
||||
ontimeout: (ev: ProgressEvent) => any;
|
||||
addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: "abort", listener: (ev: Event) => 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;
|
||||
@@ -12612,11 +12615,17 @@ interface NodeListOf<TNode extends Node> extends NodeList {
|
||||
[index: number]: TNode;
|
||||
}
|
||||
|
||||
|
||||
interface BlobPropertyBag {
|
||||
type?: string;
|
||||
endings?: string;
|
||||
}
|
||||
|
||||
interface FilePropertyBag {
|
||||
type?: string;
|
||||
lastModified?: number;
|
||||
}
|
||||
|
||||
interface EventListenerObject {
|
||||
handleEvent(evt: Event): void;
|
||||
}
|
||||
@@ -12952,4 +12961,4 @@ declare function addEventListener(type: "unload", listener: (ev: Event) => any,
|
||||
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;
|
||||
declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
|
||||
Vendored
+146
-2535
File diff suppressed because it is too large
Load Diff
Vendored
-2305
File diff suppressed because it is too large
Load Diff
Vendored
+125
-19
@@ -3,10 +3,28 @@
|
||||
/// IE Worker APIs
|
||||
/////////////////////////////
|
||||
|
||||
interface EventInit {
|
||||
bubbles?: boolean;
|
||||
cancelable?: boolean;
|
||||
}
|
||||
|
||||
interface EventListener {
|
||||
(evt: Event): void;
|
||||
}
|
||||
|
||||
interface AudioBuffer {
|
||||
duration: number;
|
||||
length: number;
|
||||
numberOfChannels: number;
|
||||
sampleRate: number;
|
||||
getChannelData(channel: number): any;
|
||||
}
|
||||
|
||||
declare var AudioBuffer: {
|
||||
prototype: AudioBuffer;
|
||||
new(): AudioBuffer;
|
||||
}
|
||||
|
||||
interface Blob {
|
||||
size: number;
|
||||
type: string;
|
||||
@@ -60,6 +78,21 @@ declare var Console: {
|
||||
new(): Console;
|
||||
}
|
||||
|
||||
interface Coordinates {
|
||||
accuracy: number;
|
||||
altitude: number;
|
||||
altitudeAccuracy: number;
|
||||
heading: number;
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
speed: number;
|
||||
}
|
||||
|
||||
declare var Coordinates: {
|
||||
prototype: Coordinates;
|
||||
new(): Coordinates;
|
||||
}
|
||||
|
||||
interface DOMError {
|
||||
name: string;
|
||||
toString(): string;
|
||||
@@ -210,7 +243,7 @@ interface File extends Blob {
|
||||
|
||||
declare var File: {
|
||||
prototype: File;
|
||||
new(): File;
|
||||
new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File;
|
||||
}
|
||||
|
||||
interface FileList {
|
||||
@@ -281,7 +314,7 @@ interface IDBDatabase extends EventTarget {
|
||||
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: "abort", 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;
|
||||
}
|
||||
@@ -402,7 +435,7 @@ interface IDBTransaction extends EventTarget {
|
||||
READ_ONLY: string;
|
||||
READ_WRITE: string;
|
||||
VERSION_CHANGE: string;
|
||||
addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: "abort", listener: (ev: Event) => 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;
|
||||
@@ -432,11 +465,14 @@ interface ImageData {
|
||||
width: number;
|
||||
}
|
||||
|
||||
declare var ImageData: {
|
||||
interface ImageDataConstructor {
|
||||
prototype: ImageData;
|
||||
new(): ImageData;
|
||||
new(width: number, height: number): ImageData;
|
||||
new(array: Uint8ClampedArray, width: number, height: number): ImageData;
|
||||
}
|
||||
|
||||
declare var ImageData: ImageDataConstructor;
|
||||
|
||||
interface MSApp {
|
||||
clearTemporaryWebDataAsync(): MSAppAsyncOperation;
|
||||
createBlobFromRandomAccessStream(type: string, seeker: any): Blob;
|
||||
@@ -460,6 +496,29 @@ interface MSApp {
|
||||
}
|
||||
declare var MSApp: MSApp;
|
||||
|
||||
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: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var MSAppAsyncOperation: {
|
||||
prototype: MSAppAsyncOperation;
|
||||
new(): MSAppAsyncOperation;
|
||||
COMPLETED: number;
|
||||
ERROR: number;
|
||||
STARTED: number;
|
||||
}
|
||||
|
||||
interface MSBlobBuilder {
|
||||
append(data: any, endings?: string): void;
|
||||
getBlob(contentType?: string): Blob;
|
||||
@@ -496,6 +555,18 @@ declare var MSStreamReader: {
|
||||
new(): MSStreamReader;
|
||||
}
|
||||
|
||||
interface MediaQueryList {
|
||||
matches: boolean;
|
||||
media: string;
|
||||
addListener(listener: MediaQueryListListener): void;
|
||||
removeListener(listener: MediaQueryListListener): void;
|
||||
}
|
||||
|
||||
declare var MediaQueryList: {
|
||||
prototype: MediaQueryList;
|
||||
new(): MediaQueryList;
|
||||
}
|
||||
|
||||
interface MessageChannel {
|
||||
port1: MessagePort;
|
||||
port2: MessagePort;
|
||||
@@ -533,6 +604,33 @@ declare var MessagePort: {
|
||||
new(): MessagePort;
|
||||
}
|
||||
|
||||
interface Position {
|
||||
coords: Coordinates;
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
declare var Position: {
|
||||
prototype: Position;
|
||||
new(): Position;
|
||||
}
|
||||
|
||||
interface PositionError {
|
||||
code: number;
|
||||
message: string;
|
||||
toString(): string;
|
||||
PERMISSION_DENIED: number;
|
||||
POSITION_UNAVAILABLE: number;
|
||||
TIMEOUT: number;
|
||||
}
|
||||
|
||||
declare var PositionError: {
|
||||
prototype: PositionError;
|
||||
new(): PositionError;
|
||||
PERMISSION_DENIED: number;
|
||||
POSITION_UNAVAILABLE: number;
|
||||
TIMEOUT: number;
|
||||
}
|
||||
|
||||
interface ProgressEvent extends Event {
|
||||
lengthComputable: boolean;
|
||||
loaded: number;
|
||||
@@ -620,7 +718,7 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget {
|
||||
LOADING: number;
|
||||
OPENED: number;
|
||||
UNSENT: number;
|
||||
addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: "abort", listener: (ev: Event) => 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;
|
||||
@@ -642,6 +740,15 @@ declare var XMLHttpRequest: {
|
||||
create(): XMLHttpRequest;
|
||||
}
|
||||
|
||||
interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget {
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
declare var XMLHttpRequestUpload: {
|
||||
prototype: XMLHttpRequestUpload;
|
||||
new(): XMLHttpRequestUpload;
|
||||
}
|
||||
|
||||
interface AbstractWorker {
|
||||
onerror: (ev: Event) => any;
|
||||
addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
|
||||
@@ -661,7 +768,7 @@ interface MSBaseReader {
|
||||
DONE: number;
|
||||
EMPTY: number;
|
||||
LOADING: number;
|
||||
addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: "abort", listener: (ev: Event) => 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;
|
||||
@@ -702,7 +809,7 @@ interface XMLHttpRequestEventTarget {
|
||||
onloadstart: (ev: Event) => any;
|
||||
onprogress: (ev: ProgressEvent) => any;
|
||||
ontimeout: (ev: ProgressEvent) => any;
|
||||
addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: "abort", listener: (ev: Event) => 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;
|
||||
@@ -788,17 +895,16 @@ interface WorkerUtils extends Object, WindowBase64 {
|
||||
}
|
||||
|
||||
|
||||
interface NodeListOf<TNode extends Node> extends NodeList {
|
||||
length: number;
|
||||
item(index: number): TNode;
|
||||
[index: number]: TNode;
|
||||
}
|
||||
|
||||
interface BlobPropertyBag {
|
||||
type?: string;
|
||||
endings?: string;
|
||||
}
|
||||
|
||||
interface FilePropertyBag {
|
||||
type?: string;
|
||||
lastModified?: number;
|
||||
}
|
||||
|
||||
interface EventListenerObject {
|
||||
handleEvent(evt: Event): void;
|
||||
}
|
||||
@@ -820,11 +926,11 @@ interface MediaQueryListListener {
|
||||
interface MSLaunchUriCallback {
|
||||
(): void;
|
||||
}
|
||||
interface FrameRequestCallback {
|
||||
(time: number): void;
|
||||
interface MSUnsafeFunctionCallback {
|
||||
(): any;
|
||||
}
|
||||
interface MutationCallback {
|
||||
(mutations: MutationRecord[], observer: MutationObserver): void;
|
||||
interface MSExecAtPriorityFunctionCallback {
|
||||
(...args: any[]): any;
|
||||
}
|
||||
interface DecodeSuccessCallback {
|
||||
(decodedData: AudioBuffer): void;
|
||||
@@ -861,4 +967,4 @@ declare function postMessage(data: any): void;
|
||||
declare var console: Console;
|
||||
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;
|
||||
declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
|
||||
+176
-47
@@ -224,6 +224,14 @@ namespace ts.server {
|
||||
this.roots.push(info);
|
||||
}
|
||||
}
|
||||
|
||||
removeRoot(info: ScriptInfo) {
|
||||
var scriptInfo = ts.lookUp(this.filenameToScript, info.fileName);
|
||||
if (scriptInfo) {
|
||||
this.filenameToScript[info.fileName] = undefined;
|
||||
this.roots = copyListRemovingItem(info, this.roots);
|
||||
}
|
||||
}
|
||||
|
||||
saveTo(filename: string, tmpfilename: string) {
|
||||
var script = this.getScriptInfo(filename);
|
||||
@@ -345,6 +353,7 @@ namespace ts.server {
|
||||
export class Project {
|
||||
compilerService: CompilerService;
|
||||
projectFilename: string;
|
||||
projectFileWatcher: FileWatcher;
|
||||
program: ts.Program;
|
||||
filenameToSourceFile: ts.Map<ts.SourceFile> = {};
|
||||
updateGraphSeq = 0;
|
||||
@@ -352,7 +361,7 @@ namespace ts.server {
|
||||
openRefCount = 0;
|
||||
|
||||
constructor(public projectService: ProjectService, public projectOptions?: ProjectOptions) {
|
||||
this.compilerService = new CompilerService(this,projectOptions && projectOptions.compilerOptions);
|
||||
this.compilerService = new CompilerService(this, projectOptions && projectOptions.compilerOptions);
|
||||
}
|
||||
|
||||
addOpenRef() {
|
||||
@@ -423,6 +432,12 @@ namespace ts.server {
|
||||
info.defaultProject = this;
|
||||
this.compilerService.host.addRoot(info);
|
||||
}
|
||||
|
||||
// remove a root file from project
|
||||
removeRoot(info: ScriptInfo) {
|
||||
info.defaultProject = undefined;
|
||||
this.compilerService.host.removeRoot(info);
|
||||
}
|
||||
|
||||
filesToString() {
|
||||
var strBuilder = "";
|
||||
@@ -517,6 +532,12 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
watchedProjectConfigFileChanged(project: Project) {
|
||||
this.log("Config File Changed: " + project.projectFilename);
|
||||
this.updateConfiguredProject(project);
|
||||
this.updateProjectStructure();
|
||||
}
|
||||
|
||||
log(msg: string, type = "Err") {
|
||||
this.psLogger.msg(msg, type);
|
||||
}
|
||||
@@ -593,6 +614,19 @@ namespace ts.server {
|
||||
}
|
||||
this.configuredProjects = configuredProjects;
|
||||
}
|
||||
|
||||
removeConfiguredProject(project: Project) {
|
||||
project.projectFileWatcher.close();
|
||||
this.configuredProjects = copyListRemovingItem(project, this.configuredProjects);
|
||||
|
||||
let fileNames = project.getFileNames();
|
||||
for (let fileName of fileNames) {
|
||||
let info = this.getScriptInfo(fileName);
|
||||
if (info.defaultProject == project){
|
||||
info.defaultProject = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setConfiguredProjectRoot(info: ScriptInfo) {
|
||||
for (var i = 0, len = this.configuredProjects.length; i < len; i++) {
|
||||
@@ -647,7 +681,6 @@ namespace ts.server {
|
||||
/**
|
||||
* Remove this file from the set of open, non-configured files.
|
||||
* @param info The file that has been closed or newly configured
|
||||
* @param openedByConfig True if info has become a root of a configured project
|
||||
*/
|
||||
closeOpenFile(info: ScriptInfo) {
|
||||
var openFileRoots: ScriptInfo[] = [];
|
||||
@@ -736,18 +769,42 @@ namespace ts.server {
|
||||
return referencingProjects;
|
||||
}
|
||||
|
||||
reloadProjects() {
|
||||
// First check if there is new tsconfig file added for inferred project roots
|
||||
for (let info of this.openFileRoots) {
|
||||
this.openOrUpdateConfiguredProjectForFile(info.fileName);
|
||||
}
|
||||
this.updateProjectStructure();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is to update the project structure for every projects.
|
||||
* It is called on the premise that all the configured projects are
|
||||
* up to date.
|
||||
*/
|
||||
updateProjectStructure() {
|
||||
this.log("updating project structure from ...", "Info");
|
||||
this.printProjects();
|
||||
|
||||
let unattachedOpenFiles: ScriptInfo[] = [];
|
||||
let openFileRootsConfigured: ScriptInfo[] = [];
|
||||
for (let info of this.openFileRootsConfigured) {
|
||||
let project = info.defaultProject;
|
||||
if (!project || !(project.getSourceFile(info))) {
|
||||
info.defaultProject = undefined;
|
||||
unattachedOpenFiles.push(info);
|
||||
}
|
||||
else {
|
||||
openFileRootsConfigured.push(info);
|
||||
}
|
||||
}
|
||||
this.openFileRootsConfigured = openFileRootsConfigured;
|
||||
|
||||
// First loop through all open files that are referenced by projects but are not
|
||||
// project roots. For each referenced file, see if the default project still
|
||||
// references that file. If so, then just keep the file in the referenced list.
|
||||
// If not, add the file to an unattached list, to be rechecked later.
|
||||
|
||||
var openFilesReferenced: ScriptInfo[] = [];
|
||||
var unattachedOpenFiles: ScriptInfo[] = [];
|
||||
|
||||
for (var i = 0, len = this.openFilesReferenced.length; i < len; i++) {
|
||||
var referencedFile = this.openFilesReferenced[i];
|
||||
referencedFile.defaultProject.updateGraph();
|
||||
@@ -857,31 +914,39 @@ namespace ts.server {
|
||||
* Open file whose contents is managed by the client
|
||||
* @param filename is absolute pathname
|
||||
*/
|
||||
|
||||
openClientFile(fileName: string) {
|
||||
var searchPath = ts.normalizePath(getDirectoryPath(fileName));
|
||||
this.log("Search path: " + searchPath,"Info");
|
||||
var configFileName = this.findConfigFile(searchPath);
|
||||
if (configFileName) {
|
||||
this.log("Config file name: " + configFileName, "Info");
|
||||
} else {
|
||||
this.log("no config file");
|
||||
}
|
||||
if (configFileName && (!this.configProjectIsActive(configFileName))) {
|
||||
var configResult = this.openConfigFile(configFileName, fileName);
|
||||
if (!configResult.success) {
|
||||
this.log("Error opening config file " + configFileName + " " + configResult.errorMsg);
|
||||
}
|
||||
else {
|
||||
this.log("Opened configuration file " + configFileName,"Info");
|
||||
this.configuredProjects.push(configResult.project);
|
||||
}
|
||||
}
|
||||
this.openOrUpdateConfiguredProjectForFile(fileName);
|
||||
var info = this.openFile(fileName, true);
|
||||
this.addOpenFile(info);
|
||||
this.printProjects();
|
||||
return info;
|
||||
}
|
||||
|
||||
openOrUpdateConfiguredProjectForFile(fileName: string) {
|
||||
let searchPath = ts.normalizePath(getDirectoryPath(fileName));
|
||||
this.log("Search path: " + searchPath,"Info");
|
||||
let configFileName = this.findConfigFile(searchPath);
|
||||
if (configFileName) {
|
||||
this.log("Config file name: " + configFileName, "Info");
|
||||
let project = this.findConfiguredProjectByConfigFile(configFileName);
|
||||
if (!project) {
|
||||
var configResult = this.openConfigFile(configFileName, fileName);
|
||||
if (!configResult.success) {
|
||||
this.log("Error opening config file " + configFileName + " " + configResult.errorMsg);
|
||||
}
|
||||
else {
|
||||
this.log("Opened configuration file " + configFileName,"Info");
|
||||
this.configuredProjects.push(configResult.project);
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.updateConfiguredProject(project);
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.log("No config files found.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Close file whose contents is managed by the client
|
||||
@@ -959,49 +1024,113 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
configProjectIsActive(fileName: string) {
|
||||
for (var i = 0, len = this.configuredProjects.length; i < len; i++) {
|
||||
if (this.configuredProjects[i].projectFilename == fileName) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return this.findConfiguredProjectByConfigFile(fileName) === undefined;
|
||||
}
|
||||
|
||||
openConfigFile(configFilename: string, clientFileName?: string): ProjectOpenResult {
|
||||
findConfiguredProjectByConfigFile(configFileName: string) {
|
||||
for (var i = 0, len = this.configuredProjects.length; i < len; i++) {
|
||||
if (this.configuredProjects[i].projectFilename == configFileName) {
|
||||
return this.configuredProjects[i];
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
configFileToProjectOptions(configFilename: string): { succeeded: boolean, projectOptions?: ProjectOptions, error?: ProjectOpenResult } {
|
||||
configFilename = ts.normalizePath(configFilename);
|
||||
// file references will be relative to dirPath (or absolute)
|
||||
var dirPath = ts.getDirectoryPath(configFilename);
|
||||
var contents = this.host.readFile(configFilename)
|
||||
var rawConfig: { config?: ProjectOptions; error?: Diagnostic; } = ts.parseConfigFileText(configFilename, contents);
|
||||
if (rawConfig.error) {
|
||||
return rawConfig.error;
|
||||
return { succeeded: false, error: rawConfig.error };
|
||||
}
|
||||
else {
|
||||
var parsedCommandLine = ts.parseConfigFile(rawConfig.config, this.host, dirPath);
|
||||
if (parsedCommandLine.errors && (parsedCommandLine.errors.length > 0)) {
|
||||
return { errorMsg: "tsconfig option errors" };
|
||||
return { succeeded: false, error: { errorMsg: "tsconfig option errors" }};
|
||||
}
|
||||
else if (parsedCommandLine.fileNames) {
|
||||
else if (parsedCommandLine.fileNames == null) {
|
||||
return { succeeded: false, error: { errorMsg: "no files found" }}
|
||||
}
|
||||
else {
|
||||
var projectOptions: ProjectOptions = {
|
||||
files: parsedCommandLine.fileNames,
|
||||
compilerOptions: parsedCommandLine.options
|
||||
};
|
||||
var proj = this.createProject(configFilename, projectOptions);
|
||||
for (var i = 0, len = parsedCommandLine.fileNames.length; i < len; i++) {
|
||||
var rootFilename = parsedCommandLine.fileNames[i];
|
||||
if (this.host.fileExists(rootFilename)) {
|
||||
var info = this.openFile(rootFilename, clientFileName == rootFilename);
|
||||
proj.addRoot(info);
|
||||
}
|
||||
else {
|
||||
return { errorMsg: "specified file " + rootFilename + " not found" };
|
||||
}
|
||||
return { succeeded: true, projectOptions };
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
openConfigFile(configFilename: string, clientFileName?: string): ProjectOpenResult {
|
||||
let { succeeded, projectOptions, error } = this.configFileToProjectOptions(configFilename);
|
||||
if (!succeeded) {
|
||||
return error;
|
||||
}
|
||||
else {
|
||||
let proj = this.createProject(configFilename, projectOptions);
|
||||
for (let i = 0, len = projectOptions.files.length; i < len; i++) {
|
||||
let rootFilename = projectOptions.files[i];
|
||||
if (this.host.fileExists(rootFilename)) {
|
||||
let info = this.openFile(rootFilename, /*openedByClient*/ clientFileName == rootFilename);
|
||||
proj.addRoot(info);
|
||||
}
|
||||
proj.finishGraph();
|
||||
return { success: true, project: proj };
|
||||
else {
|
||||
return { errorMsg: "specified file " + rootFilename + " not found" };
|
||||
}
|
||||
}
|
||||
proj.finishGraph();
|
||||
proj.projectFileWatcher = this.host.watchFile(configFilename, _ => this.watchedProjectConfigFileChanged(proj));
|
||||
return { success: true, project: proj };
|
||||
}
|
||||
}
|
||||
|
||||
updateConfiguredProject(project: Project) {
|
||||
if (!this.host.fileExists(project.projectFilename)) {
|
||||
this.log("Config file deleted");
|
||||
this.removeConfiguredProject(project);
|
||||
}
|
||||
else {
|
||||
let { succeeded, projectOptions, error } = this.configFileToProjectOptions(project.projectFilename);
|
||||
if (!succeeded) {
|
||||
return error;
|
||||
}
|
||||
else {
|
||||
return { errorMsg: "no files found" };
|
||||
let oldFileNames = project.compilerService.host.roots.map(info => info.fileName);
|
||||
let newFileNames = projectOptions.files;
|
||||
let fileNamesToRemove = oldFileNames.filter(f => newFileNames.indexOf(f) < 0);
|
||||
let fileNamesToAdd = newFileNames.filter(f => oldFileNames.indexOf(f) < 0);
|
||||
|
||||
for (let fileName of fileNamesToRemove) {
|
||||
let info = this.getScriptInfo(fileName);
|
||||
project.removeRoot(info);
|
||||
}
|
||||
|
||||
for (let fileName of fileNamesToAdd) {
|
||||
let info = this.getScriptInfo(fileName);
|
||||
if (!info) {
|
||||
info = this.openFile(fileName, false);
|
||||
}
|
||||
else {
|
||||
// if the root file was opened by client, it would belong to either
|
||||
// openFileRoots or openFileReferenced.
|
||||
if (info.isOpen) {
|
||||
if (this.openFileRoots.indexOf(info) >= 0) {
|
||||
this.openFileRoots = copyListRemovingItem(info, this.openFileRoots);
|
||||
}
|
||||
if (this.openFilesReferenced.indexOf(info) >= 0) {
|
||||
this.openFilesReferenced = copyListRemovingItem(info, this.openFilesReferenced);
|
||||
}
|
||||
this.openFileRootsConfigured.push(info);
|
||||
}
|
||||
}
|
||||
project.addRoot(info);
|
||||
}
|
||||
|
||||
project.setProjectOptions(projectOptions);
|
||||
project.finishGraph();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+6
@@ -31,6 +31,12 @@ declare namespace ts.server.protocol {
|
||||
*/
|
||||
arguments?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request to reload the project structure for all the opened files
|
||||
*/
|
||||
export interface ReloadProjectsRequest extends Message {
|
||||
}
|
||||
|
||||
/**
|
||||
* Server-initiated event message
|
||||
|
||||
@@ -100,6 +100,7 @@ namespace ts.server {
|
||||
export const SignatureHelp = "signatureHelp";
|
||||
export const TypeDefinition = "typeDefinition";
|
||||
export const ProjectInfo = "projectInfo";
|
||||
export const ReloadProjects = "reloadProjects";
|
||||
export const Unknown = "unknown";
|
||||
}
|
||||
|
||||
@@ -226,6 +227,10 @@ namespace ts.server {
|
||||
this.syntacticCheck(file, project);
|
||||
this.semanticCheck(file, project);
|
||||
}
|
||||
|
||||
private reloadProjects() {
|
||||
this.projectService.reloadProjects();
|
||||
}
|
||||
|
||||
private updateProjectStructure(seq: number, matchSeq: (seq: number) => boolean, ms = 1500) {
|
||||
setTimeout(() => {
|
||||
@@ -1033,6 +1038,10 @@ namespace ts.server {
|
||||
var { file, needFileNameList } = <protocol.ProjectInfoRequestArgs>request.arguments;
|
||||
return {response: this.getProjectInfo(file, needFileNameList), responseRequired: true};
|
||||
},
|
||||
[CommandNames.ReloadProjects]: (request: protocol.ReloadProjectsRequest) => {
|
||||
this.reloadProjects();
|
||||
return {responseRequired: false};
|
||||
}
|
||||
};
|
||||
public addProtocolHandler(command: string, handler: (request: protocol.Request) => {response?: any, responseRequired: boolean}) {
|
||||
if (this.handlers[command]) {
|
||||
|
||||
+101
-8
@@ -132,6 +132,46 @@ namespace ts {
|
||||
let scanner: Scanner = createScanner(ScriptTarget.Latest, /*skipTrivia*/ true);
|
||||
|
||||
let emptyArray: any[] = [];
|
||||
|
||||
const jsDocTagNames = [
|
||||
"augments",
|
||||
"author",
|
||||
"argument",
|
||||
"borrows",
|
||||
"class",
|
||||
"constant",
|
||||
"constructor",
|
||||
"constructs",
|
||||
"default",
|
||||
"deprecated",
|
||||
"description",
|
||||
"event",
|
||||
"example",
|
||||
"extends",
|
||||
"field",
|
||||
"fileOverview",
|
||||
"function",
|
||||
"ignore",
|
||||
"inner",
|
||||
"lends",
|
||||
"link",
|
||||
"memberOf",
|
||||
"name",
|
||||
"namespace",
|
||||
"param",
|
||||
"private",
|
||||
"property",
|
||||
"public",
|
||||
"requires",
|
||||
"returns",
|
||||
"see",
|
||||
"since",
|
||||
"static",
|
||||
"throws",
|
||||
"type",
|
||||
"version"
|
||||
];
|
||||
let jsDocCompletionEntries: CompletionEntry[];
|
||||
|
||||
function createNode(kind: SyntaxKind, pos: number, end: number, flags: NodeFlags, parent?: Node): NodeObject {
|
||||
let node = <NodeObject> new (getNodeConstructor(kind))();
|
||||
@@ -1842,9 +1882,8 @@ namespace ts {
|
||||
getCanonicalFileName: fileName => fileName,
|
||||
getCurrentDirectory: () => "",
|
||||
getNewLine: () => newLine,
|
||||
// these two methods should never be called in transpile scenarios since 'noResolve' is set to 'true'
|
||||
fileExists: (fileName): boolean => { throw new Error("Should never be called."); },
|
||||
readFile: (fileName): string => { throw new Error("Should never be called."); }
|
||||
fileExists: (fileName): boolean => fileName === inputFileName,
|
||||
readFile: (fileName): string => ""
|
||||
};
|
||||
|
||||
let program = createProgram([inputFileName], options, compilerHost);
|
||||
@@ -2972,6 +3011,8 @@ namespace ts {
|
||||
let sourceFile = getValidSourceFile(fileName);
|
||||
let isJavaScriptFile = isJavaScript(fileName);
|
||||
|
||||
let isJsDocTagName = false;
|
||||
|
||||
let start = new Date().getTime();
|
||||
let currentToken = getTokenAtPosition(sourceFile, position);
|
||||
log("getCompletionData: Get current token: " + (new Date().getTime() - start));
|
||||
@@ -2982,8 +3023,44 @@ namespace ts {
|
||||
log("getCompletionData: Is inside comment: " + (new Date().getTime() - start));
|
||||
|
||||
if (insideComment) {
|
||||
log("Returning an empty list because completion was inside a comment.");
|
||||
return undefined;
|
||||
// The current position is next to the '@' sign, when no tag name being provided yet.
|
||||
// Provide a full list of tag names
|
||||
if (hasDocComment(sourceFile, position) && sourceFile.text.charCodeAt(position - 1) === CharacterCodes.at) {
|
||||
isJsDocTagName = true;
|
||||
}
|
||||
|
||||
// Completion should work inside certain JsDoc tags. For example:
|
||||
// /** @type {number | string} */
|
||||
// Completion should work in the brackets
|
||||
let insideJsDocTagExpression = false;
|
||||
let tag = getJsDocTagAtPosition(sourceFile, position);
|
||||
if (tag) {
|
||||
if (tag.tagName.pos <= position && position <= tag.tagName.end) {
|
||||
isJsDocTagName = true;
|
||||
}
|
||||
|
||||
switch (tag.kind) {
|
||||
case SyntaxKind.JSDocTypeTag:
|
||||
case SyntaxKind.JSDocParameterTag:
|
||||
case SyntaxKind.JSDocReturnTag:
|
||||
let tagWithExpression = <JSDocTypeTag | JSDocParameterTag | JSDocReturnTag>tag;
|
||||
if (tagWithExpression.typeExpression) {
|
||||
insideJsDocTagExpression = tagWithExpression.typeExpression.pos < position && position < tagWithExpression.typeExpression.end;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isJsDocTagName) {
|
||||
return { symbols: undefined, isMemberCompletion: false, isNewIdentifierLocation: false, location: undefined, isRightOfDot: false, isJsDocTagName };
|
||||
}
|
||||
|
||||
if (!insideJsDocTagExpression) {
|
||||
// Proceed if the current position is in jsDoc tag expression; otherwise it is a normal
|
||||
// comment or the plain text part of a jsDoc comment, so no completion should be available
|
||||
log("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment.");
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
start = new Date().getTime();
|
||||
@@ -3069,7 +3146,7 @@ namespace ts {
|
||||
|
||||
log("getCompletionData: Semantic work: " + (new Date().getTime() - semanticStart));
|
||||
|
||||
return { symbols, isMemberCompletion, isNewIdentifierLocation, location, isRightOfDot: (isRightOfDot || isRightOfOpenTag) };
|
||||
return { symbols, isMemberCompletion, isNewIdentifierLocation, location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), isJsDocTagName };
|
||||
|
||||
function getTypeScriptMemberSymbols(): void {
|
||||
// Right of dot member completion list
|
||||
@@ -3709,9 +3786,14 @@ namespace ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let { symbols, isMemberCompletion, isNewIdentifierLocation, location, isRightOfDot } = completionData;
|
||||
let { symbols, isMemberCompletion, isNewIdentifierLocation, location, isRightOfDot, isJsDocTagName } = completionData;
|
||||
|
||||
let entries: CompletionEntry[];
|
||||
if (isJsDocTagName) {
|
||||
// If the current position is a jsDoc tag name, only tag names should be provided for completion
|
||||
return { isMemberCompletion: false, isNewIdentifierLocation: false, entries: getAllJsDocCompletionEntries() };
|
||||
}
|
||||
|
||||
if (isRightOfDot && isJavaScript(fileName)) {
|
||||
entries = getCompletionEntriesFromSymbols(symbols);
|
||||
addRange(entries, getJavaScriptCompletionEntries());
|
||||
@@ -3725,7 +3807,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
// Add keywords if this is not a member completion list
|
||||
if (!isMemberCompletion) {
|
||||
if (!isMemberCompletion && !isJsDocTagName) {
|
||||
addRange(entries, keywordCompletions);
|
||||
}
|
||||
|
||||
@@ -3758,6 +3840,17 @@ namespace ts {
|
||||
return entries;
|
||||
}
|
||||
|
||||
function getAllJsDocCompletionEntries(): CompletionEntry[] {
|
||||
return jsDocCompletionEntries || (jsDocCompletionEntries = ts.map(jsDocTagNames, tagName => {
|
||||
return {
|
||||
name: tagName,
|
||||
kind: ScriptElementKind.keyword,
|
||||
kindModifiers: "",
|
||||
sortText: "0",
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
@@ -1097,4 +1097,4 @@ module TypeScript.Services {
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
let toolsVersion = "1.5";
|
||||
const toolsVersion = "1.6";
|
||||
|
||||
@@ -469,6 +469,39 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the corresponding JSDocTag node if the position is in a jsDoc comment
|
||||
*/
|
||||
export function getJsDocTagAtPosition(sourceFile: SourceFile, position: number): JSDocTag {
|
||||
let node = ts.getTokenAtPosition(sourceFile, position);
|
||||
if (isToken(node)) {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.VarKeyword:
|
||||
case SyntaxKind.LetKeyword:
|
||||
case SyntaxKind.ConstKeyword:
|
||||
// if the current token is var, let or const, skip the VariableDeclarationList
|
||||
node = node.parent === undefined ? undefined : node.parent.parent;
|
||||
break;
|
||||
default:
|
||||
node = node.parent;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (node) {
|
||||
let jsDocComment = node.jsDocComment;
|
||||
if (jsDocComment) {
|
||||
for (let tag of jsDocComment.tags) {
|
||||
if (tag.pos <= position && position <= tag.end) {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function nodeHasTokens(n: Node): boolean {
|
||||
// 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.
|
||||
@@ -640,7 +673,6 @@ namespace ts {
|
||||
else if (flags & SymbolFlags.TypeAlias) { return SymbolDisplayPartKind.aliasName; }
|
||||
else if (flags & SymbolFlags.Alias) { return SymbolDisplayPartKind.aliasName; }
|
||||
|
||||
|
||||
return SymbolDisplayPartKind.text;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe
|
||||
let blah = arguments[Symbol.iterator];
|
||||
>blah : Symbol(blah, Decl(argumentsObjectIterator02_ES6.ts, 2, 7))
|
||||
>arguments : Symbol(arguments)
|
||||
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1249, 31))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1199, 52), Decl(lib.d.ts, 1305, 11))
|
||||
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1249, 31))
|
||||
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 3890, 31))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.d.ts, 3840, 52), Decl(lib.d.ts, 3946, 11))
|
||||
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 3890, 31))
|
||||
|
||||
let result = [];
|
||||
>result : Symbol(result, Decl(argumentsObjectIterator02_ES6.ts, 4, 7))
|
||||
|
||||
@@ -72,14 +72,14 @@ var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]];
|
||||
|
||||
interface myArray extends Array<Number> { }
|
||||
>myArray : Symbol(myArray, Decl(arrayLiterals2ES6.ts, 40, 67))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1452, 1))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 4091, 1))
|
||||
>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11))
|
||||
|
||||
interface myArray2 extends Array<Number|String> { }
|
||||
>myArray2 : Symbol(myArray2, Decl(arrayLiterals2ES6.ts, 42, 43))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1452, 1))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 4091, 1))
|
||||
>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1556, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 4209, 1))
|
||||
|
||||
var d0 = [1, true, ...temp, ]; // has type (string|number|boolean)[]
|
||||
>d0 : Symbol(d0, Decl(arrayLiterals2ES6.ts, 44, 3))
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
var foo = async (): Promise<void> => {
|
||||
>foo : Symbol(foo, Decl(asyncArrowFunction1_es6.ts, 1, 3))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
};
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
type MyPromise<T> = Promise<T>;
|
||||
>MyPromise : Symbol(MyPromise, Decl(asyncAwait_es6.ts, 0, 0), Decl(asyncAwait_es6.ts, 1, 11))
|
||||
>T : Symbol(T, Decl(asyncAwait_es6.ts, 0, 15))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>T : Symbol(T, Decl(asyncAwait_es6.ts, 0, 15))
|
||||
|
||||
declare var MyPromise: typeof Promise;
|
||||
>MyPromise : Symbol(MyPromise, Decl(asyncAwait_es6.ts, 0, 0), Decl(asyncAwait_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare var p: Promise<number>;
|
||||
>p : Symbol(p, Decl(asyncAwait_es6.ts, 2, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare var mp: MyPromise<number>;
|
||||
>mp : Symbol(mp, Decl(asyncAwait_es6.ts, 3, 11))
|
||||
@@ -22,7 +22,7 @@ async function f0() { }
|
||||
|
||||
async function f1(): Promise<void> { }
|
||||
>f1 : Symbol(f1, Decl(asyncAwait_es6.ts, 5, 23))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
async function f3(): MyPromise<void> { }
|
||||
>f3 : Symbol(f3, Decl(asyncAwait_es6.ts, 6, 38))
|
||||
@@ -33,7 +33,7 @@ let f4 = async function() { }
|
||||
|
||||
let f5 = async function(): Promise<void> { }
|
||||
>f5 : Symbol(f5, Decl(asyncAwait_es6.ts, 10, 3))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
let f6 = async function(): MyPromise<void> { }
|
||||
>f6 : Symbol(f6, Decl(asyncAwait_es6.ts, 11, 3))
|
||||
@@ -44,7 +44,7 @@ let f7 = async () => { };
|
||||
|
||||
let f8 = async (): Promise<void> => { };
|
||||
>f8 : Symbol(f8, Decl(asyncAwait_es6.ts, 14, 3))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
let f9 = async (): MyPromise<void> => { };
|
||||
>f9 : Symbol(f9, Decl(asyncAwait_es6.ts, 15, 3))
|
||||
@@ -60,7 +60,7 @@ let f11 = async () => mp;
|
||||
|
||||
let f12 = async (): Promise<number> => mp;
|
||||
>f12 : Symbol(f12, Decl(asyncAwait_es6.ts, 18, 3))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>mp : Symbol(mp, Decl(asyncAwait_es6.ts, 3, 11))
|
||||
|
||||
let f13 = async (): MyPromise<number> => p;
|
||||
@@ -76,7 +76,7 @@ let o = {
|
||||
|
||||
async m2(): Promise<void> { },
|
||||
>m2 : Symbol(m2, Decl(asyncAwait_es6.ts, 22, 16))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
async m3(): MyPromise<void> { }
|
||||
>m3 : Symbol(m3, Decl(asyncAwait_es6.ts, 23, 31))
|
||||
@@ -92,7 +92,7 @@ class C {
|
||||
|
||||
async m2(): Promise<void> { }
|
||||
>m2 : Symbol(m2, Decl(asyncAwait_es6.ts, 28, 15))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
async m3(): MyPromise<void> { }
|
||||
>m3 : Symbol(m3, Decl(asyncAwait_es6.ts, 29, 30))
|
||||
@@ -103,7 +103,7 @@ class C {
|
||||
|
||||
static async m5(): Promise<void> { }
|
||||
>m5 : Symbol(C.m5, Decl(asyncAwait_es6.ts, 31, 22))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
static async m6(): MyPromise<void> { }
|
||||
>m6 : Symbol(C.m6, Decl(asyncAwait_es6.ts, 32, 37))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
=== tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration11_es6.ts ===
|
||||
async function await(): Promise<void> {
|
||||
>await : Symbol(await, Decl(asyncFunctionDeclaration11_es6.ts, 0, 0))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=== tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration14_es6.ts ===
|
||||
async function foo(): Promise<void> {
|
||||
>foo : Symbol(foo, Decl(asyncFunctionDeclaration14_es6.ts, 0, 0))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
=== tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration1_es6.ts ===
|
||||
async function foo(): Promise<void> {
|
||||
>foo : Symbol(foo, Decl(asyncFunctionDeclaration1_es6.ts, 0, 0))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitBinaryExpression1_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitBinaryExpression1_es6.ts, 1, 32))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = await p || a;
|
||||
|
||||
@@ -4,11 +4,11 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitBinaryExpression2_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitBinaryExpression2_es6.ts, 1, 32))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = await p && a;
|
||||
|
||||
@@ -4,11 +4,11 @@ declare var a: number;
|
||||
|
||||
declare var p: Promise<number>;
|
||||
>p : Symbol(p, Decl(awaitBinaryExpression3_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitBinaryExpression3_es6.ts, 1, 31))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = await p + a;
|
||||
|
||||
@@ -4,11 +4,11 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitBinaryExpression4_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitBinaryExpression4_es6.ts, 1, 32))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = await p, a;
|
||||
|
||||
@@ -4,11 +4,11 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitBinaryExpression5_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitBinaryExpression5_es6.ts, 1, 32))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var o: { a: boolean; };
|
||||
|
||||
@@ -4,7 +4,7 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitCallExpression1_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression1_es6.ts, 1, 32))
|
||||
@@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
|
||||
|
||||
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>pfn : Symbol(pfn, Decl(awaitCallExpression1_es6.ts, 4, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression1_es6.ts, 4, 28))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression1_es6.ts, 4, 42))
|
||||
>arg2 : Symbol(arg2, Decl(awaitCallExpression1_es6.ts, 4, 57))
|
||||
|
||||
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>po : Symbol(po, Decl(awaitCallExpression1_es6.ts, 5, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression1_es6.ts, 5, 25))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression1_es6.ts, 5, 29))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression1_es6.ts, 5, 43))
|
||||
@@ -36,7 +36,7 @@ declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitCallExpression1_es6.ts, 5, 84))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = fn(a, a, a);
|
||||
|
||||
@@ -4,7 +4,7 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitCallExpression2_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression2_es6.ts, 1, 32))
|
||||
@@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
|
||||
|
||||
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>pfn : Symbol(pfn, Decl(awaitCallExpression2_es6.ts, 4, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression2_es6.ts, 4, 28))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression2_es6.ts, 4, 42))
|
||||
>arg2 : Symbol(arg2, Decl(awaitCallExpression2_es6.ts, 4, 57))
|
||||
|
||||
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>po : Symbol(po, Decl(awaitCallExpression2_es6.ts, 5, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression2_es6.ts, 5, 25))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression2_es6.ts, 5, 29))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression2_es6.ts, 5, 43))
|
||||
@@ -36,7 +36,7 @@ declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitCallExpression2_es6.ts, 5, 84))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = fn(await p, a, a);
|
||||
|
||||
@@ -4,7 +4,7 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitCallExpression3_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression3_es6.ts, 1, 32))
|
||||
@@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
|
||||
|
||||
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>pfn : Symbol(pfn, Decl(awaitCallExpression3_es6.ts, 4, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression3_es6.ts, 4, 28))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression3_es6.ts, 4, 42))
|
||||
>arg2 : Symbol(arg2, Decl(awaitCallExpression3_es6.ts, 4, 57))
|
||||
|
||||
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>po : Symbol(po, Decl(awaitCallExpression3_es6.ts, 5, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression3_es6.ts, 5, 25))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression3_es6.ts, 5, 29))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression3_es6.ts, 5, 43))
|
||||
@@ -36,7 +36,7 @@ declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitCallExpression3_es6.ts, 5, 84))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = fn(a, await p, a);
|
||||
|
||||
@@ -4,7 +4,7 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitCallExpression4_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression4_es6.ts, 1, 32))
|
||||
@@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
|
||||
|
||||
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>pfn : Symbol(pfn, Decl(awaitCallExpression4_es6.ts, 4, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression4_es6.ts, 4, 28))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression4_es6.ts, 4, 42))
|
||||
>arg2 : Symbol(arg2, Decl(awaitCallExpression4_es6.ts, 4, 57))
|
||||
|
||||
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>po : Symbol(po, Decl(awaitCallExpression4_es6.ts, 5, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression4_es6.ts, 5, 25))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression4_es6.ts, 5, 29))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression4_es6.ts, 5, 43))
|
||||
@@ -36,7 +36,7 @@ declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitCallExpression4_es6.ts, 5, 84))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = (await pfn)(a, a, a);
|
||||
|
||||
@@ -4,7 +4,7 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitCallExpression5_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression5_es6.ts, 1, 32))
|
||||
@@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
|
||||
|
||||
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>pfn : Symbol(pfn, Decl(awaitCallExpression5_es6.ts, 4, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression5_es6.ts, 4, 28))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression5_es6.ts, 4, 42))
|
||||
>arg2 : Symbol(arg2, Decl(awaitCallExpression5_es6.ts, 4, 57))
|
||||
|
||||
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>po : Symbol(po, Decl(awaitCallExpression5_es6.ts, 5, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression5_es6.ts, 5, 25))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression5_es6.ts, 5, 29))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression5_es6.ts, 5, 43))
|
||||
@@ -36,7 +36,7 @@ declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitCallExpression5_es6.ts, 5, 84))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = o.fn(a, a, a);
|
||||
|
||||
@@ -4,7 +4,7 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitCallExpression6_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression6_es6.ts, 1, 32))
|
||||
@@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
|
||||
|
||||
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>pfn : Symbol(pfn, Decl(awaitCallExpression6_es6.ts, 4, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression6_es6.ts, 4, 28))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression6_es6.ts, 4, 42))
|
||||
>arg2 : Symbol(arg2, Decl(awaitCallExpression6_es6.ts, 4, 57))
|
||||
|
||||
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>po : Symbol(po, Decl(awaitCallExpression6_es6.ts, 5, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression6_es6.ts, 5, 25))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression6_es6.ts, 5, 29))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression6_es6.ts, 5, 43))
|
||||
@@ -36,7 +36,7 @@ declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitCallExpression6_es6.ts, 5, 84))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = o.fn(await p, a, a);
|
||||
|
||||
@@ -4,7 +4,7 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitCallExpression7_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression7_es6.ts, 1, 32))
|
||||
@@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
|
||||
|
||||
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>pfn : Symbol(pfn, Decl(awaitCallExpression7_es6.ts, 4, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression7_es6.ts, 4, 28))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression7_es6.ts, 4, 42))
|
||||
>arg2 : Symbol(arg2, Decl(awaitCallExpression7_es6.ts, 4, 57))
|
||||
|
||||
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>po : Symbol(po, Decl(awaitCallExpression7_es6.ts, 5, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression7_es6.ts, 5, 25))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression7_es6.ts, 5, 29))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression7_es6.ts, 5, 43))
|
||||
@@ -36,7 +36,7 @@ declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitCallExpression7_es6.ts, 5, 84))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = o.fn(a, await p, a);
|
||||
|
||||
@@ -4,7 +4,7 @@ declare var a: boolean;
|
||||
|
||||
declare var p: Promise<boolean>;
|
||||
>p : Symbol(p, Decl(awaitCallExpression8_es6.ts, 1, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression8_es6.ts, 1, 32))
|
||||
@@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
|
||||
|
||||
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>pfn : Symbol(pfn, Decl(awaitCallExpression8_es6.ts, 4, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression8_es6.ts, 4, 28))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression8_es6.ts, 4, 42))
|
||||
>arg2 : Symbol(arg2, Decl(awaitCallExpression8_es6.ts, 4, 57))
|
||||
|
||||
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
|
||||
>po : Symbol(po, Decl(awaitCallExpression8_es6.ts, 5, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
>fn : Symbol(fn, Decl(awaitCallExpression8_es6.ts, 5, 25))
|
||||
>arg0 : Symbol(arg0, Decl(awaitCallExpression8_es6.ts, 5, 29))
|
||||
>arg1 : Symbol(arg1, Decl(awaitCallExpression8_es6.ts, 5, 43))
|
||||
@@ -36,7 +36,7 @@ declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
|
||||
|
||||
async function func(): Promise<void> {
|
||||
>func : Symbol(func, Decl(awaitCallExpression8_es6.ts, 5, 84))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 4772, 1), Decl(lib.d.ts, 4858, 11))
|
||||
>Promise : Symbol(Promise, Decl(lib.d.ts, 5041, 1), Decl(lib.d.ts, 5127, 11))
|
||||
|
||||
"before";
|
||||
var b = (await po).fn(a, a, a);
|
||||
|
||||
@@ -94,7 +94,7 @@ xa[1].foo(1, 2, ...a, "abc");
|
||||
>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3))
|
||||
|
||||
(<Function>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, 1368, 1))
|
||||
>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11), Decl(lib.d.ts, 4009, 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))
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
//// [tests/cases/compiler/commonjsSafeImport.ts] ////
|
||||
|
||||
//// [10_lib.ts]
|
||||
|
||||
export function Foo() {}
|
||||
|
||||
//// [main.ts]
|
||||
import { Foo } from './10_lib';
|
||||
|
||||
Foo();
|
||||
|
||||
|
||||
//// [10_lib.js]
|
||||
function Foo() { }
|
||||
exports.Foo = Foo;
|
||||
//// [main.js]
|
||||
var _10_lib_1 = require('./10_lib');
|
||||
_10_lib_1.Foo();
|
||||
|
||||
|
||||
//// [10_lib.d.ts]
|
||||
export declare function Foo(): void;
|
||||
//// [main.d.ts]
|
||||
@@ -0,0 +1,12 @@
|
||||
=== tests/cases/compiler/10_lib.ts ===
|
||||
|
||||
export function Foo() {}
|
||||
>Foo : Symbol(Foo, Decl(10_lib.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/main.ts ===
|
||||
import { Foo } from './10_lib';
|
||||
>Foo : Symbol(Foo, Decl(main.ts, 0, 8))
|
||||
|
||||
Foo();
|
||||
>Foo : Symbol(Foo, Decl(main.ts, 0, 8))
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/compiler/10_lib.ts ===
|
||||
|
||||
export function Foo() {}
|
||||
>Foo : () => void
|
||||
|
||||
=== tests/cases/compiler/main.ts ===
|
||||
import { Foo } from './10_lib';
|
||||
>Foo : () => void
|
||||
|
||||
Foo();
|
||||
>Foo() : void
|
||||
>Foo : () => void
|
||||
|
||||
@@ -34,6 +34,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var service_1 = require("./service");
|
||||
var MyComponent = (function () {
|
||||
function MyComponent(Service) {
|
||||
this.Service = Service;
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
//// [decoratorMetadataWithConstructorType.ts]
|
||||
|
||||
declare var console: {
|
||||
log(msg: string): void;
|
||||
};
|
||||
|
||||
class A {
|
||||
constructor() { console.log('new A'); }
|
||||
}
|
||||
|
||||
function decorator(target: Object, propertyKey: string) {
|
||||
}
|
||||
|
||||
export class B {
|
||||
@decorator
|
||||
x: A = new A();
|
||||
}
|
||||
|
||||
|
||||
//// [decoratorMetadataWithConstructorType.js]
|
||||
var A = (function () {
|
||||
function A() {
|
||||
console.log('new A');
|
||||
}
|
||||
return A;
|
||||
})();
|
||||
function decorator(target, propertyKey) {
|
||||
}
|
||||
var B = (function () {
|
||||
function B() {
|
||||
this.x = new A();
|
||||
}
|
||||
__decorate([
|
||||
decorator,
|
||||
__metadata('design:type', A)
|
||||
], B.prototype, "x");
|
||||
return B;
|
||||
})();
|
||||
exports.B = B;
|
||||
@@ -0,0 +1,39 @@
|
||||
=== tests/cases/compiler/decoratorMetadataWithConstructorType.ts ===
|
||||
|
||||
declare var console: {
|
||||
>console : Symbol(console, Decl(decoratorMetadataWithConstructorType.ts, 1, 11))
|
||||
|
||||
log(msg: string): void;
|
||||
>log : Symbol(log, Decl(decoratorMetadataWithConstructorType.ts, 1, 22))
|
||||
>msg : Symbol(msg, Decl(decoratorMetadataWithConstructorType.ts, 2, 8))
|
||||
|
||||
};
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(decoratorMetadataWithConstructorType.ts, 3, 2))
|
||||
|
||||
constructor() { console.log('new A'); }
|
||||
>console.log : Symbol(log, Decl(decoratorMetadataWithConstructorType.ts, 1, 22))
|
||||
>console : Symbol(console, Decl(decoratorMetadataWithConstructorType.ts, 1, 11))
|
||||
>log : Symbol(log, Decl(decoratorMetadataWithConstructorType.ts, 1, 22))
|
||||
}
|
||||
|
||||
function decorator(target: Object, propertyKey: string) {
|
||||
>decorator : Symbol(decorator, Decl(decoratorMetadataWithConstructorType.ts, 7, 1))
|
||||
>target : Symbol(target, Decl(decoratorMetadataWithConstructorType.ts, 9, 19))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11))
|
||||
>propertyKey : Symbol(propertyKey, Decl(decoratorMetadataWithConstructorType.ts, 9, 34))
|
||||
}
|
||||
|
||||
export class B {
|
||||
>B : Symbol(B, Decl(decoratorMetadataWithConstructorType.ts, 10, 1))
|
||||
|
||||
@decorator
|
||||
>decorator : Symbol(decorator, Decl(decoratorMetadataWithConstructorType.ts, 7, 1))
|
||||
|
||||
x: A = new A();
|
||||
>x : Symbol(x, Decl(decoratorMetadataWithConstructorType.ts, 12, 16))
|
||||
>A : Symbol(A, Decl(decoratorMetadataWithConstructorType.ts, 3, 2))
|
||||
>A : Symbol(A, Decl(decoratorMetadataWithConstructorType.ts, 3, 2))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
=== tests/cases/compiler/decoratorMetadataWithConstructorType.ts ===
|
||||
|
||||
declare var console: {
|
||||
>console : { log(msg: string): void; }
|
||||
|
||||
log(msg: string): void;
|
||||
>log : (msg: string) => void
|
||||
>msg : string
|
||||
|
||||
};
|
||||
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
constructor() { console.log('new A'); }
|
||||
>console.log('new A') : void
|
||||
>console.log : (msg: string) => void
|
||||
>console : { log(msg: string): void; }
|
||||
>log : (msg: string) => void
|
||||
>'new A' : string
|
||||
}
|
||||
|
||||
function decorator(target: Object, propertyKey: string) {
|
||||
>decorator : (target: Object, propertyKey: string) => void
|
||||
>target : Object
|
||||
>Object : Object
|
||||
>propertyKey : string
|
||||
}
|
||||
|
||||
export class B {
|
||||
>B : B
|
||||
|
||||
@decorator
|
||||
>decorator : (target: Object, propertyKey: string) => void
|
||||
|
||||
x: A = new A();
|
||||
>x : A
|
||||
>A : A
|
||||
>new A() : A
|
||||
>A : typeof A
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
//// [tests/cases/compiler/decoratorMetadataWithImportDeclarationNameCollision.ts] ////
|
||||
|
||||
//// [db.ts]
|
||||
export class db {
|
||||
public doSomething() {
|
||||
}
|
||||
}
|
||||
|
||||
//// [service.ts]
|
||||
import {db} from './db';
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
@someDecorator
|
||||
class MyClass {
|
||||
db: db;
|
||||
|
||||
constructor(db: db) {
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
|
||||
|
||||
//// [db.js]
|
||||
var db = (function () {
|
||||
function db() {
|
||||
}
|
||||
db.prototype.doSomething = function () {
|
||||
};
|
||||
return db;
|
||||
})();
|
||||
exports.db = db;
|
||||
//// [service.js]
|
||||
var db_1 = require('./db');
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
var MyClass = (function () {
|
||||
function MyClass(db) {
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata('design:paramtypes', [db_1.db])
|
||||
], MyClass);
|
||||
return MyClass;
|
||||
})();
|
||||
exports.MyClass = MyClass;
|
||||
@@ -0,0 +1,51 @@
|
||||
=== tests/cases/compiler/db.ts ===
|
||||
export class db {
|
||||
>db : Symbol(db, Decl(db.ts, 0, 0))
|
||||
|
||||
public doSomething() {
|
||||
>doSomething : Symbol(doSomething, Decl(db.ts, 0, 17))
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/service.ts ===
|
||||
import {db} from './db';
|
||||
>db : Symbol(db, Decl(service.ts, 0, 8))
|
||||
|
||||
function someDecorator(target) {
|
||||
>someDecorator : Symbol(someDecorator, Decl(service.ts, 0, 24))
|
||||
>target : Symbol(target, Decl(service.ts, 1, 23))
|
||||
|
||||
return target;
|
||||
>target : Symbol(target, Decl(service.ts, 1, 23))
|
||||
}
|
||||
@someDecorator
|
||||
>someDecorator : Symbol(someDecorator, Decl(service.ts, 0, 24))
|
||||
|
||||
class MyClass {
|
||||
>MyClass : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
|
||||
db: db;
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>db : Symbol(db, Decl(service.ts, 0, 8))
|
||||
|
||||
constructor(db: db) {
|
||||
>db : Symbol(db, Decl(service.ts, 8, 16))
|
||||
>db : Symbol(db, Decl(service.ts, 0, 8))
|
||||
|
||||
this.db = db;
|
||||
>this.db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>this : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>db : Symbol(db, Decl(service.ts, 8, 16))
|
||||
|
||||
this.db.doSomething();
|
||||
>this.db.doSomething : Symbol(db.doSomething, Decl(db.ts, 0, 17))
|
||||
>this.db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>this : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>doSomething : Symbol(db.doSomething, Decl(db.ts, 0, 17))
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
>MyClass : Symbol(MyClass, Decl(service.ts, 13, 8))
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
=== tests/cases/compiler/db.ts ===
|
||||
export class db {
|
||||
>db : db
|
||||
|
||||
public doSomething() {
|
||||
>doSomething : () => void
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/service.ts ===
|
||||
import {db} from './db';
|
||||
>db : typeof db
|
||||
|
||||
function someDecorator(target) {
|
||||
>someDecorator : (target: any) => any
|
||||
>target : any
|
||||
|
||||
return target;
|
||||
>target : any
|
||||
}
|
||||
@someDecorator
|
||||
>someDecorator : (target: any) => any
|
||||
|
||||
class MyClass {
|
||||
>MyClass : MyClass
|
||||
|
||||
db: db;
|
||||
>db : db
|
||||
>db : db
|
||||
|
||||
constructor(db: db) {
|
||||
>db : db
|
||||
>db : db
|
||||
|
||||
this.db = db;
|
||||
>this.db = db : db
|
||||
>this.db : db
|
||||
>this : MyClass
|
||||
>db : db
|
||||
>db : db
|
||||
|
||||
this.db.doSomething();
|
||||
>this.db.doSomething() : void
|
||||
>this.db.doSomething : () => void
|
||||
>this.db : db
|
||||
>this : MyClass
|
||||
>db : db
|
||||
>doSomething : () => void
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
>MyClass : typeof MyClass
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
//// [tests/cases/compiler/decoratorMetadataWithImportDeclarationNameCollision2.ts] ////
|
||||
|
||||
//// [db.ts]
|
||||
export class db {
|
||||
public doSomething() {
|
||||
}
|
||||
}
|
||||
|
||||
//// [service.ts]
|
||||
import {db as Database} from './db';
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
@someDecorator
|
||||
class MyClass {
|
||||
db: Database;
|
||||
|
||||
constructor(db: Database) { // no collision
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
|
||||
|
||||
//// [db.js]
|
||||
var db = (function () {
|
||||
function db() {
|
||||
}
|
||||
db.prototype.doSomething = function () {
|
||||
};
|
||||
return db;
|
||||
})();
|
||||
exports.db = db;
|
||||
//// [service.js]
|
||||
var db_1 = require('./db');
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
var MyClass = (function () {
|
||||
function MyClass(db) {
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata('design:paramtypes', [db_1.db])
|
||||
], MyClass);
|
||||
return MyClass;
|
||||
})();
|
||||
exports.MyClass = MyClass;
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
=== tests/cases/compiler/db.ts ===
|
||||
export class db {
|
||||
>db : Symbol(db, Decl(db.ts, 0, 0))
|
||||
|
||||
public doSomething() {
|
||||
>doSomething : Symbol(doSomething, Decl(db.ts, 0, 17))
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/service.ts ===
|
||||
import {db as Database} from './db';
|
||||
>db : Symbol(Database, Decl(service.ts, 0, 8))
|
||||
>Database : Symbol(Database, Decl(service.ts, 0, 8))
|
||||
|
||||
function someDecorator(target) {
|
||||
>someDecorator : Symbol(someDecorator, Decl(service.ts, 0, 36))
|
||||
>target : Symbol(target, Decl(service.ts, 1, 23))
|
||||
|
||||
return target;
|
||||
>target : Symbol(target, Decl(service.ts, 1, 23))
|
||||
}
|
||||
@someDecorator
|
||||
>someDecorator : Symbol(someDecorator, Decl(service.ts, 0, 36))
|
||||
|
||||
class MyClass {
|
||||
>MyClass : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
|
||||
db: Database;
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>Database : Symbol(Database, Decl(service.ts, 0, 8))
|
||||
|
||||
constructor(db: Database) { // no collision
|
||||
>db : Symbol(db, Decl(service.ts, 8, 16))
|
||||
>Database : Symbol(Database, Decl(service.ts, 0, 8))
|
||||
|
||||
this.db = db;
|
||||
>this.db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>this : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>db : Symbol(db, Decl(service.ts, 8, 16))
|
||||
|
||||
this.db.doSomething();
|
||||
>this.db.doSomething : Symbol(Database.doSomething, Decl(db.ts, 0, 17))
|
||||
>this.db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>this : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>doSomething : Symbol(Database.doSomething, Decl(db.ts, 0, 17))
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
>MyClass : Symbol(MyClass, Decl(service.ts, 13, 8))
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
=== tests/cases/compiler/db.ts ===
|
||||
export class db {
|
||||
>db : db
|
||||
|
||||
public doSomething() {
|
||||
>doSomething : () => void
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/service.ts ===
|
||||
import {db as Database} from './db';
|
||||
>db : typeof Database
|
||||
>Database : typeof Database
|
||||
|
||||
function someDecorator(target) {
|
||||
>someDecorator : (target: any) => any
|
||||
>target : any
|
||||
|
||||
return target;
|
||||
>target : any
|
||||
}
|
||||
@someDecorator
|
||||
>someDecorator : (target: any) => any
|
||||
|
||||
class MyClass {
|
||||
>MyClass : MyClass
|
||||
|
||||
db: Database;
|
||||
>db : Database
|
||||
>Database : Database
|
||||
|
||||
constructor(db: Database) { // no collision
|
||||
>db : Database
|
||||
>Database : Database
|
||||
|
||||
this.db = db;
|
||||
>this.db = db : Database
|
||||
>this.db : Database
|
||||
>this : MyClass
|
||||
>db : Database
|
||||
>db : Database
|
||||
|
||||
this.db.doSomething();
|
||||
>this.db.doSomething() : void
|
||||
>this.db.doSomething : () => void
|
||||
>this.db : Database
|
||||
>this : MyClass
|
||||
>db : Database
|
||||
>doSomething : () => void
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
>MyClass : typeof MyClass
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
//// [tests/cases/compiler/decoratorMetadataWithImportDeclarationNameCollision3.ts] ////
|
||||
|
||||
//// [db.ts]
|
||||
export class db {
|
||||
public doSomething() {
|
||||
}
|
||||
}
|
||||
|
||||
//// [service.ts]
|
||||
import db = require('./db');
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
@someDecorator
|
||||
class MyClass {
|
||||
db: db.db;
|
||||
|
||||
constructor(db: db.db) { // collision with namespace of external module db
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
|
||||
|
||||
//// [db.js]
|
||||
var db = (function () {
|
||||
function db() {
|
||||
}
|
||||
db.prototype.doSomething = function () {
|
||||
};
|
||||
return db;
|
||||
})();
|
||||
exports.db = db;
|
||||
//// [service.js]
|
||||
var db = require('./db');
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
var MyClass = (function () {
|
||||
function MyClass(db) {
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata('design:paramtypes', [db.db])
|
||||
], MyClass);
|
||||
return MyClass;
|
||||
})();
|
||||
exports.MyClass = MyClass;
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
=== tests/cases/compiler/service.ts ===
|
||||
import db = require('./db');
|
||||
>db : Symbol(db, Decl(service.ts, 0, 0))
|
||||
|
||||
function someDecorator(target) {
|
||||
>someDecorator : Symbol(someDecorator, Decl(service.ts, 0, 28))
|
||||
>target : Symbol(target, Decl(service.ts, 1, 23))
|
||||
|
||||
return target;
|
||||
>target : Symbol(target, Decl(service.ts, 1, 23))
|
||||
}
|
||||
@someDecorator
|
||||
>someDecorator : Symbol(someDecorator, Decl(service.ts, 0, 28))
|
||||
|
||||
class MyClass {
|
||||
>MyClass : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
|
||||
db: db.db;
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>db : Symbol(db, Decl(service.ts, 0, 0))
|
||||
>db : Symbol(db.db, Decl(db.ts, 0, 0))
|
||||
|
||||
constructor(db: db.db) { // collision with namespace of external module db
|
||||
>db : Symbol(db, Decl(service.ts, 8, 16))
|
||||
>db : Symbol(db, Decl(service.ts, 0, 0))
|
||||
>db : Symbol(db.db, Decl(db.ts, 0, 0))
|
||||
|
||||
this.db = db;
|
||||
>this.db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>this : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>db : Symbol(db, Decl(service.ts, 8, 16))
|
||||
|
||||
this.db.doSomething();
|
||||
>this.db.doSomething : Symbol(db.db.doSomething, Decl(db.ts, 0, 17))
|
||||
>this.db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>this : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>doSomething : Symbol(db.db.doSomething, Decl(db.ts, 0, 17))
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
>MyClass : Symbol(MyClass, Decl(service.ts, 13, 8))
|
||||
|
||||
=== tests/cases/compiler/db.ts ===
|
||||
export class db {
|
||||
>db : Symbol(db, Decl(db.ts, 0, 0))
|
||||
|
||||
public doSomething() {
|
||||
>doSomething : Symbol(doSomething, Decl(db.ts, 0, 17))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
=== tests/cases/compiler/service.ts ===
|
||||
import db = require('./db');
|
||||
>db : typeof db
|
||||
|
||||
function someDecorator(target) {
|
||||
>someDecorator : (target: any) => any
|
||||
>target : any
|
||||
|
||||
return target;
|
||||
>target : any
|
||||
}
|
||||
@someDecorator
|
||||
>someDecorator : (target: any) => any
|
||||
|
||||
class MyClass {
|
||||
>MyClass : MyClass
|
||||
|
||||
db: db.db;
|
||||
>db : db.db
|
||||
>db : any
|
||||
>db : db.db
|
||||
|
||||
constructor(db: db.db) { // collision with namespace of external module db
|
||||
>db : db.db
|
||||
>db : any
|
||||
>db : db.db
|
||||
|
||||
this.db = db;
|
||||
>this.db = db : db.db
|
||||
>this.db : db.db
|
||||
>this : MyClass
|
||||
>db : db.db
|
||||
>db : db.db
|
||||
|
||||
this.db.doSomething();
|
||||
>this.db.doSomething() : void
|
||||
>this.db.doSomething : () => void
|
||||
>this.db : db.db
|
||||
>this : MyClass
|
||||
>db : db.db
|
||||
>doSomething : () => void
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
>MyClass : typeof MyClass
|
||||
|
||||
=== tests/cases/compiler/db.ts ===
|
||||
export class db {
|
||||
>db : db
|
||||
|
||||
public doSomething() {
|
||||
>doSomething : () => void
|
||||
}
|
||||
}
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
tests/cases/compiler/service.ts(1,8): error TS1192: Module '"tests/cases/compiler/db"' has no default export.
|
||||
|
||||
|
||||
==== tests/cases/compiler/db.ts (0 errors) ====
|
||||
export class db {
|
||||
public doSomething() {
|
||||
}
|
||||
}
|
||||
|
||||
==== tests/cases/compiler/service.ts (1 errors) ====
|
||||
import db from './db'; // error no default export
|
||||
~~
|
||||
!!! error TS1192: Module '"tests/cases/compiler/db"' has no default export.
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
@someDecorator
|
||||
class MyClass {
|
||||
db: db.db;
|
||||
|
||||
constructor(db: db.db) {
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
//// [tests/cases/compiler/decoratorMetadataWithImportDeclarationNameCollision4.ts] ////
|
||||
|
||||
//// [db.ts]
|
||||
export class db {
|
||||
public doSomething() {
|
||||
}
|
||||
}
|
||||
|
||||
//// [service.ts]
|
||||
import db from './db'; // error no default export
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
@someDecorator
|
||||
class MyClass {
|
||||
db: db.db;
|
||||
|
||||
constructor(db: db.db) {
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
|
||||
|
||||
//// [db.js]
|
||||
var db = (function () {
|
||||
function db() {
|
||||
}
|
||||
db.prototype.doSomething = function () {
|
||||
};
|
||||
return db;
|
||||
})();
|
||||
exports.db = db;
|
||||
//// [service.js]
|
||||
var db_1 = require('./db'); // error no default export
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
var MyClass = (function () {
|
||||
function MyClass(db) {
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata('design:paramtypes', [Object])
|
||||
], MyClass);
|
||||
return MyClass;
|
||||
})();
|
||||
exports.MyClass = MyClass;
|
||||
@@ -0,0 +1,52 @@
|
||||
//// [tests/cases/compiler/decoratorMetadataWithImportDeclarationNameCollision5.ts] ////
|
||||
|
||||
//// [db.ts]
|
||||
export default class db {
|
||||
public doSomething() {
|
||||
}
|
||||
}
|
||||
|
||||
//// [service.ts]
|
||||
import db from './db';
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
@someDecorator
|
||||
class MyClass {
|
||||
db: db;
|
||||
|
||||
constructor(db: db) { // collision
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
|
||||
|
||||
//// [db.js]
|
||||
var db = (function () {
|
||||
function db() {
|
||||
}
|
||||
db.prototype.doSomething = function () {
|
||||
};
|
||||
return db;
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = db;
|
||||
//// [service.js]
|
||||
var db_1 = require('./db');
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
var MyClass = (function () {
|
||||
function MyClass(db) {
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata('design:paramtypes', [db_1.default])
|
||||
], MyClass);
|
||||
return MyClass;
|
||||
})();
|
||||
exports.MyClass = MyClass;
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
=== tests/cases/compiler/db.ts ===
|
||||
export default class db {
|
||||
>db : Symbol(db, Decl(db.ts, 0, 0))
|
||||
|
||||
public doSomething() {
|
||||
>doSomething : Symbol(doSomething, Decl(db.ts, 0, 25))
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/service.ts ===
|
||||
import db from './db';
|
||||
>db : Symbol(db, Decl(service.ts, 0, 6))
|
||||
|
||||
function someDecorator(target) {
|
||||
>someDecorator : Symbol(someDecorator, Decl(service.ts, 0, 22))
|
||||
>target : Symbol(target, Decl(service.ts, 1, 23))
|
||||
|
||||
return target;
|
||||
>target : Symbol(target, Decl(service.ts, 1, 23))
|
||||
}
|
||||
@someDecorator
|
||||
>someDecorator : Symbol(someDecorator, Decl(service.ts, 0, 22))
|
||||
|
||||
class MyClass {
|
||||
>MyClass : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
|
||||
db: db;
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>db : Symbol(db, Decl(service.ts, 0, 6))
|
||||
|
||||
constructor(db: db) { // collision
|
||||
>db : Symbol(db, Decl(service.ts, 8, 16))
|
||||
>db : Symbol(db, Decl(service.ts, 0, 6))
|
||||
|
||||
this.db = db;
|
||||
>this.db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>this : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>db : Symbol(db, Decl(service.ts, 8, 16))
|
||||
|
||||
this.db.doSomething();
|
||||
>this.db.doSomething : Symbol(db.doSomething, Decl(db.ts, 0, 25))
|
||||
>this.db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>this : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>doSomething : Symbol(db.doSomething, Decl(db.ts, 0, 25))
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
>MyClass : Symbol(MyClass, Decl(service.ts, 13, 8))
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
=== tests/cases/compiler/db.ts ===
|
||||
export default class db {
|
||||
>db : db
|
||||
|
||||
public doSomething() {
|
||||
>doSomething : () => void
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/service.ts ===
|
||||
import db from './db';
|
||||
>db : typeof db
|
||||
|
||||
function someDecorator(target) {
|
||||
>someDecorator : (target: any) => any
|
||||
>target : any
|
||||
|
||||
return target;
|
||||
>target : any
|
||||
}
|
||||
@someDecorator
|
||||
>someDecorator : (target: any) => any
|
||||
|
||||
class MyClass {
|
||||
>MyClass : MyClass
|
||||
|
||||
db: db;
|
||||
>db : db
|
||||
>db : db
|
||||
|
||||
constructor(db: db) { // collision
|
||||
>db : db
|
||||
>db : db
|
||||
|
||||
this.db = db;
|
||||
>this.db = db : db
|
||||
>this.db : db
|
||||
>this : MyClass
|
||||
>db : db
|
||||
>db : db
|
||||
|
||||
this.db.doSomething();
|
||||
>this.db.doSomething() : void
|
||||
>this.db.doSomething : () => void
|
||||
>this.db : db
|
||||
>this : MyClass
|
||||
>db : db
|
||||
>doSomething : () => void
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
>MyClass : typeof MyClass
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
//// [tests/cases/compiler/decoratorMetadataWithImportDeclarationNameCollision6.ts] ////
|
||||
|
||||
//// [db.ts]
|
||||
export default class db {
|
||||
public doSomething() {
|
||||
}
|
||||
}
|
||||
|
||||
//// [service.ts]
|
||||
import database from './db';
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
@someDecorator
|
||||
class MyClass {
|
||||
db: database;
|
||||
|
||||
constructor(db: database) { // no collision
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
|
||||
|
||||
//// [db.js]
|
||||
var db = (function () {
|
||||
function db() {
|
||||
}
|
||||
db.prototype.doSomething = function () {
|
||||
};
|
||||
return db;
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = db;
|
||||
//// [service.js]
|
||||
var db_1 = require('./db');
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
var MyClass = (function () {
|
||||
function MyClass(db) {
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata('design:paramtypes', [db_1.default])
|
||||
], MyClass);
|
||||
return MyClass;
|
||||
})();
|
||||
exports.MyClass = MyClass;
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
=== tests/cases/compiler/db.ts ===
|
||||
export default class db {
|
||||
>db : Symbol(db, Decl(db.ts, 0, 0))
|
||||
|
||||
public doSomething() {
|
||||
>doSomething : Symbol(doSomething, Decl(db.ts, 0, 25))
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/service.ts ===
|
||||
import database from './db';
|
||||
>database : Symbol(database, Decl(service.ts, 0, 6))
|
||||
|
||||
function someDecorator(target) {
|
||||
>someDecorator : Symbol(someDecorator, Decl(service.ts, 0, 28))
|
||||
>target : Symbol(target, Decl(service.ts, 1, 23))
|
||||
|
||||
return target;
|
||||
>target : Symbol(target, Decl(service.ts, 1, 23))
|
||||
}
|
||||
@someDecorator
|
||||
>someDecorator : Symbol(someDecorator, Decl(service.ts, 0, 28))
|
||||
|
||||
class MyClass {
|
||||
>MyClass : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
|
||||
db: database;
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>database : Symbol(database, Decl(service.ts, 0, 6))
|
||||
|
||||
constructor(db: database) { // no collision
|
||||
>db : Symbol(db, Decl(service.ts, 8, 16))
|
||||
>database : Symbol(database, Decl(service.ts, 0, 6))
|
||||
|
||||
this.db = db;
|
||||
>this.db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>this : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>db : Symbol(db, Decl(service.ts, 8, 16))
|
||||
|
||||
this.db.doSomething();
|
||||
>this.db.doSomething : Symbol(database.doSomething, Decl(db.ts, 0, 25))
|
||||
>this.db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>this : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>doSomething : Symbol(database.doSomething, Decl(db.ts, 0, 25))
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
>MyClass : Symbol(MyClass, Decl(service.ts, 13, 8))
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
=== tests/cases/compiler/db.ts ===
|
||||
export default class db {
|
||||
>db : db
|
||||
|
||||
public doSomething() {
|
||||
>doSomething : () => void
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/service.ts ===
|
||||
import database from './db';
|
||||
>database : typeof database
|
||||
|
||||
function someDecorator(target) {
|
||||
>someDecorator : (target: any) => any
|
||||
>target : any
|
||||
|
||||
return target;
|
||||
>target : any
|
||||
}
|
||||
@someDecorator
|
||||
>someDecorator : (target: any) => any
|
||||
|
||||
class MyClass {
|
||||
>MyClass : MyClass
|
||||
|
||||
db: database;
|
||||
>db : database
|
||||
>database : database
|
||||
|
||||
constructor(db: database) { // no collision
|
||||
>db : database
|
||||
>database : database
|
||||
|
||||
this.db = db;
|
||||
>this.db = db : database
|
||||
>this.db : database
|
||||
>this : MyClass
|
||||
>db : database
|
||||
>db : database
|
||||
|
||||
this.db.doSomething();
|
||||
>this.db.doSomething() : void
|
||||
>this.db.doSomething : () => void
|
||||
>this.db : database
|
||||
>this : MyClass
|
||||
>db : database
|
||||
>doSomething : () => void
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
>MyClass : typeof MyClass
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
tests/cases/compiler/service.ts(7,9): error TS2503: Cannot find namespace 'db'.
|
||||
tests/cases/compiler/service.ts(9,21): error TS2503: Cannot find namespace 'db'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/db.ts (0 errors) ====
|
||||
export default class db {
|
||||
public doSomething() {
|
||||
}
|
||||
}
|
||||
|
||||
==== tests/cases/compiler/service.ts (2 errors) ====
|
||||
import db from './db';
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
@someDecorator
|
||||
class MyClass {
|
||||
db: db.db; //error
|
||||
~~
|
||||
!!! error TS2503: Cannot find namespace 'db'.
|
||||
|
||||
constructor(db: db.db) { // error
|
||||
~~
|
||||
!!! error TS2503: Cannot find namespace 'db'.
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
//// [tests/cases/compiler/decoratorMetadataWithImportDeclarationNameCollision7.ts] ////
|
||||
|
||||
//// [db.ts]
|
||||
export default class db {
|
||||
public doSomething() {
|
||||
}
|
||||
}
|
||||
|
||||
//// [service.ts]
|
||||
import db from './db';
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
@someDecorator
|
||||
class MyClass {
|
||||
db: db.db; //error
|
||||
|
||||
constructor(db: db.db) { // error
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
|
||||
|
||||
//// [db.js]
|
||||
var db = (function () {
|
||||
function db() {
|
||||
}
|
||||
db.prototype.doSomething = function () {
|
||||
};
|
||||
return db;
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = db;
|
||||
//// [service.js]
|
||||
var db_1 = require('./db');
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
var MyClass = (function () {
|
||||
function MyClass(db) {
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata('design:paramtypes', [Object])
|
||||
], MyClass);
|
||||
return MyClass;
|
||||
})();
|
||||
exports.MyClass = MyClass;
|
||||
@@ -0,0 +1,51 @@
|
||||
//// [tests/cases/compiler/decoratorMetadataWithImportDeclarationNameCollision8.ts] ////
|
||||
|
||||
//// [db.ts]
|
||||
export class db {
|
||||
public doSomething() {
|
||||
}
|
||||
}
|
||||
|
||||
//// [service.ts]
|
||||
import database = require('./db');
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
@someDecorator
|
||||
class MyClass {
|
||||
db: database.db;
|
||||
|
||||
constructor(db: database.db) { // no collision
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
|
||||
|
||||
//// [db.js]
|
||||
var db = (function () {
|
||||
function db() {
|
||||
}
|
||||
db.prototype.doSomething = function () {
|
||||
};
|
||||
return db;
|
||||
})();
|
||||
exports.db = db;
|
||||
//// [service.js]
|
||||
var database = require('./db');
|
||||
function someDecorator(target) {
|
||||
return target;
|
||||
}
|
||||
var MyClass = (function () {
|
||||
function MyClass(db) {
|
||||
this.db = db;
|
||||
this.db.doSomething();
|
||||
}
|
||||
MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata('design:paramtypes', [database.db])
|
||||
], MyClass);
|
||||
return MyClass;
|
||||
})();
|
||||
exports.MyClass = MyClass;
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
=== tests/cases/compiler/service.ts ===
|
||||
import database = require('./db');
|
||||
>database : Symbol(database, Decl(service.ts, 0, 0))
|
||||
|
||||
function someDecorator(target) {
|
||||
>someDecorator : Symbol(someDecorator, Decl(service.ts, 0, 34))
|
||||
>target : Symbol(target, Decl(service.ts, 1, 23))
|
||||
|
||||
return target;
|
||||
>target : Symbol(target, Decl(service.ts, 1, 23))
|
||||
}
|
||||
@someDecorator
|
||||
>someDecorator : Symbol(someDecorator, Decl(service.ts, 0, 34))
|
||||
|
||||
class MyClass {
|
||||
>MyClass : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
|
||||
db: database.db;
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>database : Symbol(database, Decl(service.ts, 0, 0))
|
||||
>db : Symbol(database.db, Decl(db.ts, 0, 0))
|
||||
|
||||
constructor(db: database.db) { // no collision
|
||||
>db : Symbol(db, Decl(service.ts, 8, 16))
|
||||
>database : Symbol(database, Decl(service.ts, 0, 0))
|
||||
>db : Symbol(database.db, Decl(db.ts, 0, 0))
|
||||
|
||||
this.db = db;
|
||||
>this.db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>this : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>db : Symbol(db, Decl(service.ts, 8, 16))
|
||||
|
||||
this.db.doSomething();
|
||||
>this.db.doSomething : Symbol(database.db.doSomething, Decl(db.ts, 0, 17))
|
||||
>this.db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>this : Symbol(MyClass, Decl(service.ts, 3, 1))
|
||||
>db : Symbol(db, Decl(service.ts, 5, 15))
|
||||
>doSomething : Symbol(database.db.doSomething, Decl(db.ts, 0, 17))
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
>MyClass : Symbol(MyClass, Decl(service.ts, 13, 8))
|
||||
|
||||
=== tests/cases/compiler/db.ts ===
|
||||
export class db {
|
||||
>db : Symbol(db, Decl(db.ts, 0, 0))
|
||||
|
||||
public doSomething() {
|
||||
>doSomething : Symbol(doSomething, Decl(db.ts, 0, 17))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
=== tests/cases/compiler/service.ts ===
|
||||
import database = require('./db');
|
||||
>database : typeof database
|
||||
|
||||
function someDecorator(target) {
|
||||
>someDecorator : (target: any) => any
|
||||
>target : any
|
||||
|
||||
return target;
|
||||
>target : any
|
||||
}
|
||||
@someDecorator
|
||||
>someDecorator : (target: any) => any
|
||||
|
||||
class MyClass {
|
||||
>MyClass : MyClass
|
||||
|
||||
db: database.db;
|
||||
>db : database.db
|
||||
>database : any
|
||||
>db : database.db
|
||||
|
||||
constructor(db: database.db) { // no collision
|
||||
>db : database.db
|
||||
>database : any
|
||||
>db : database.db
|
||||
|
||||
this.db = db;
|
||||
>this.db = db : database.db
|
||||
>this.db : database.db
|
||||
>this : MyClass
|
||||
>db : database.db
|
||||
>db : database.db
|
||||
|
||||
this.db.doSomething();
|
||||
>this.db.doSomething() : void
|
||||
>this.db.doSomething : () => void
|
||||
>this.db : database.db
|
||||
>this : MyClass
|
||||
>db : database.db
|
||||
>doSomething : () => void
|
||||
}
|
||||
}
|
||||
export {MyClass};
|
||||
>MyClass : typeof MyClass
|
||||
|
||||
=== tests/cases/compiler/db.ts ===
|
||||
export class db {
|
||||
>db : db
|
||||
|
||||
public doSomething() {
|
||||
>doSomething : () => void
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,18 +8,18 @@
|
||||
|
||||
type arrayString = Array<String>
|
||||
>arrayString : Symbol(arrayString, Decl(destructuringParameterDeclaration3ES5.ts, 0, 0))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1452, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1556, 1))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 4091, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 4209, 1))
|
||||
|
||||
type someArray = Array<String> | number[];
|
||||
>someArray : Symbol(someArray, Decl(destructuringParameterDeclaration3ES5.ts, 7, 32))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1452, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1556, 1))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 4091, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 4209, 1))
|
||||
|
||||
type stringOrNumArray = Array<String|Number>;
|
||||
>stringOrNumArray : Symbol(stringOrNumArray, Decl(destructuringParameterDeclaration3ES5.ts, 8, 42))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1452, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1556, 1))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 4091, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 4209, 1))
|
||||
>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11))
|
||||
|
||||
function a1(...x: (number|string)[]) { }
|
||||
@@ -33,8 +33,8 @@ function a2(...a) { }
|
||||
function a3(...a: Array<String>) { }
|
||||
>a3 : Symbol(a3, Decl(destructuringParameterDeclaration3ES5.ts, 12, 21))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5.ts, 13, 12))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1452, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1556, 1))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 4091, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 4209, 1))
|
||||
|
||||
function a4(...a: arrayString) { }
|
||||
>a4 : Symbol(a4, Decl(destructuringParameterDeclaration3ES5.ts, 13, 36))
|
||||
|
||||
@@ -8,18 +8,18 @@
|
||||
|
||||
type arrayString = Array<String>
|
||||
>arrayString : Symbol(arrayString, Decl(destructuringParameterDeclaration3ES6.ts, 0, 0))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1452, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1556, 1))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 4091, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 4209, 1))
|
||||
|
||||
type someArray = Array<String> | number[];
|
||||
>someArray : Symbol(someArray, Decl(destructuringParameterDeclaration3ES6.ts, 7, 32))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1452, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1556, 1))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 4091, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 4209, 1))
|
||||
|
||||
type stringOrNumArray = Array<String|Number>;
|
||||
>stringOrNumArray : Symbol(stringOrNumArray, Decl(destructuringParameterDeclaration3ES6.ts, 8, 42))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1452, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1556, 1))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 4091, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 4209, 1))
|
||||
>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11))
|
||||
|
||||
function a1(...x: (number|string)[]) { }
|
||||
@@ -33,8 +33,8 @@ function a2(...a) { }
|
||||
function a3(...a: Array<String>) { }
|
||||
>a3 : Symbol(a3, Decl(destructuringParameterDeclaration3ES6.ts, 12, 21))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration3ES6.ts, 13, 12))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1452, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1556, 1))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 4091, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 4209, 1))
|
||||
|
||||
function a4(...a: arrayString) { }
|
||||
>a4 : Symbol(a4, Decl(destructuringParameterDeclaration3ES6.ts, 13, 36))
|
||||
|
||||
@@ -5,7 +5,7 @@ function f() {
|
||||
|
||||
if (Math.random()) {
|
||||
>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1704, 60))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 4392, 60))
|
||||
>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
|
||||
let arguments = 100;
|
||||
|
||||
@@ -8,7 +8,7 @@ function f() {
|
||||
|
||||
if (Math.random()) {
|
||||
>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1704, 60))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 4392, 60))
|
||||
>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
|
||||
const arguments = 100;
|
||||
|
||||
@@ -8,7 +8,7 @@ function f() {
|
||||
|
||||
if (Math.random()) {
|
||||
>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1704, 60))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 4392, 60))
|
||||
>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
|
||||
return () => arguments[0];
|
||||
|
||||
@@ -9,7 +9,7 @@ function f() {
|
||||
|
||||
if (Math.random()) {
|
||||
>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1704, 60))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 4392, 60))
|
||||
>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
|
||||
return () => arguments[0];
|
||||
|
||||
@@ -10,7 +10,7 @@ function f() {
|
||||
|
||||
if (Math.random()) {
|
||||
>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1704, 60))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 4392, 60))
|
||||
>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
|
||||
return () => arguments;
|
||||
|
||||
@@ -4,6 +4,6 @@ var v: string;
|
||||
|
||||
for (v of [""].values()) { }
|
||||
>v : Symbol(v, Decl(for-of13.ts, 0, 3))
|
||||
>[""].values : Symbol(Array.values, Decl(lib.d.ts, 1466, 37))
|
||||
>values : Symbol(Array.values, Decl(lib.d.ts, 1466, 37))
|
||||
>[""].values : Symbol(Array.values, Decl(lib.d.ts, 4119, 37))
|
||||
>values : Symbol(Array.values, Decl(lib.d.ts, 4119, 37))
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user