mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into inlineSourceMaps
This commit is contained in:
Vendored
+1
-1
@@ -561,7 +561,7 @@ interface Math {
|
||||
*/
|
||||
atan(x: number): number;
|
||||
/**
|
||||
* Returns the angle (in radians) from the X axis to a point (y,x).
|
||||
* Returns the angle (in radians) from the X axis to a point.
|
||||
* @param y A numeric expression representing the cartesian y-coordinate.
|
||||
* @param x A numeric expression representing the cartesian x-coordinate.
|
||||
*/
|
||||
|
||||
Vendored
+2
-2
@@ -561,7 +561,7 @@ interface Math {
|
||||
*/
|
||||
atan(x: number): number;
|
||||
/**
|
||||
* Returns the angle (in radians) from the X axis to a point (y,x).
|
||||
* Returns the angle (in radians) from the X axis to a point.
|
||||
* @param y A numeric expression representing the cartesian y-coordinate.
|
||||
* @param x A numeric expression representing the cartesian x-coordinate.
|
||||
*/
|
||||
@@ -1628,7 +1628,7 @@ interface IteratorResult<T> {
|
||||
}
|
||||
|
||||
interface Iterator<T> {
|
||||
next(): IteratorResult<T>;
|
||||
next(value?: any): IteratorResult<T>;
|
||||
return?(value?: any): IteratorResult<T>;
|
||||
throw?(e?: any): IteratorResult<T>;
|
||||
}
|
||||
|
||||
Vendored
+24
-24
@@ -561,7 +561,7 @@ interface Math {
|
||||
*/
|
||||
atan(x: number): number;
|
||||
/**
|
||||
* Returns the angle (in radians) from the X axis to a point (y,x).
|
||||
* Returns the angle (in radians) from the X axis to a point.
|
||||
* @param y A numeric expression representing the cartesian y-coordinate.
|
||||
* @param x A numeric expression representing the cartesian x-coordinate.
|
||||
*/
|
||||
@@ -13878,7 +13878,7 @@ interface SourceBuffer extends EventTarget {
|
||||
videoTracks: VideoTrackList;
|
||||
abort(): void;
|
||||
appendBuffer(data: ArrayBuffer): void;
|
||||
appendBuffer(data: any): void;
|
||||
appendBuffer(data: ArrayBufferView): void;
|
||||
appendStream(stream: MSStream, maxSize?: number): void;
|
||||
remove(start: number, end: number): void;
|
||||
}
|
||||
@@ -13986,31 +13986,31 @@ declare var StyleSheetPageList: {
|
||||
}
|
||||
|
||||
interface SubtleCrypto {
|
||||
decrypt(algorithm: string, key: CryptoKey, data: any): any;
|
||||
decrypt(algorithm: Algorithm, key: CryptoKey, data: any): any;
|
||||
decrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any;
|
||||
decrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any;
|
||||
deriveBits(algorithm: string, baseKey: CryptoKey, length: number): any;
|
||||
deriveBits(algorithm: Algorithm, baseKey: CryptoKey, length: number): any;
|
||||
deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any;
|
||||
deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any;
|
||||
deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
digest(algorithm: string, data: any): any;
|
||||
digest(algorithm: Algorithm, data: any): any;
|
||||
encrypt(algorithm: string, key: CryptoKey, data: any): any;
|
||||
encrypt(algorithm: Algorithm, key: CryptoKey, data: any): any;
|
||||
digest(algorithm: string, data: ArrayBufferView): any;
|
||||
digest(algorithm: Algorithm, data: ArrayBufferView): any;
|
||||
encrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any;
|
||||
encrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any;
|
||||
exportKey(format: string, key: CryptoKey): any;
|
||||
generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
generateKey(algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
importKey(format: string, keyData: any, algorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
importKey(format: string, keyData: any, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
sign(algorithm: string, key: CryptoKey, data: any): any;
|
||||
sign(algorithm: Algorithm, key: CryptoKey, data: any): any;
|
||||
unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
verify(algorithm: string, key: CryptoKey, signature: any, data: any): any;
|
||||
verify(algorithm: Algorithm, key: CryptoKey, signature: any, data: any): any;
|
||||
importKey(format: string, keyData: ArrayBufferView, algorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
importKey(format: string, keyData: ArrayBufferView, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
sign(algorithm: string, key: CryptoKey, data: ArrayBufferView): any;
|
||||
sign(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any;
|
||||
unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
verify(algorithm: string, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any;
|
||||
verify(algorithm: Algorithm, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any;
|
||||
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string): any;
|
||||
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: Algorithm): any;
|
||||
}
|
||||
@@ -14522,9 +14522,9 @@ interface WebGLRenderingContext {
|
||||
blendFunc(sfactor: number, dfactor: number): void;
|
||||
blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void;
|
||||
bufferData(target: number, size: number, usage: number): void;
|
||||
bufferData(target: number, size: ArrayBufferView, usage: number): void;
|
||||
bufferData(target: number, size: any, usage: number): void;
|
||||
bufferData(target: number, size: any, usage: number): void;
|
||||
bufferSubData(target: number, offset: number, data: any): void;
|
||||
bufferSubData(target: number, offset: number, data: ArrayBufferView): void;
|
||||
bufferSubData(target: number, offset: number, data: any): void;
|
||||
checkFramebufferStatus(target: number): number;
|
||||
clear(mask: number): void;
|
||||
@@ -14533,8 +14533,8 @@ interface WebGLRenderingContext {
|
||||
clearStencil(s: number): void;
|
||||
colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void;
|
||||
compileShader(shader: WebGLShader): void;
|
||||
compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: any): void;
|
||||
compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: any): void;
|
||||
compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void;
|
||||
compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void;
|
||||
copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void;
|
||||
copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void;
|
||||
createBuffer(): WebGLBuffer;
|
||||
@@ -14602,7 +14602,7 @@ interface WebGLRenderingContext {
|
||||
linkProgram(program: WebGLProgram): void;
|
||||
pixelStorei(pname: number, param: number): void;
|
||||
polygonOffset(factor: number, units: number): void;
|
||||
readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: any): void;
|
||||
readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void;
|
||||
renderbufferStorage(target: number, internalformat: number, width: number, height: number): void;
|
||||
sampleCoverage(value: number, invert: boolean): void;
|
||||
scissor(x: number, y: number, width: number, height: number): void;
|
||||
@@ -16026,7 +16026,7 @@ interface NodeSelector {
|
||||
}
|
||||
|
||||
interface RandomSource {
|
||||
getRandomValues(array: any): any;
|
||||
getRandomValues(array: ArrayBufferView): ArrayBufferView;
|
||||
}
|
||||
|
||||
interface SVGAnimatedPathData {
|
||||
|
||||
Vendored
+23
-23
@@ -12708,7 +12708,7 @@ interface SourceBuffer extends EventTarget {
|
||||
videoTracks: VideoTrackList;
|
||||
abort(): void;
|
||||
appendBuffer(data: ArrayBuffer): void;
|
||||
appendBuffer(data: any): void;
|
||||
appendBuffer(data: ArrayBufferView): void;
|
||||
appendStream(stream: MSStream, maxSize?: number): void;
|
||||
remove(start: number, end: number): void;
|
||||
}
|
||||
@@ -12816,31 +12816,31 @@ declare var StyleSheetPageList: {
|
||||
}
|
||||
|
||||
interface SubtleCrypto {
|
||||
decrypt(algorithm: string, key: CryptoKey, data: any): any;
|
||||
decrypt(algorithm: Algorithm, key: CryptoKey, data: any): any;
|
||||
decrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any;
|
||||
decrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any;
|
||||
deriveBits(algorithm: string, baseKey: CryptoKey, length: number): any;
|
||||
deriveBits(algorithm: Algorithm, baseKey: CryptoKey, length: number): any;
|
||||
deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any;
|
||||
deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any;
|
||||
deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
digest(algorithm: string, data: any): any;
|
||||
digest(algorithm: Algorithm, data: any): any;
|
||||
encrypt(algorithm: string, key: CryptoKey, data: any): any;
|
||||
encrypt(algorithm: Algorithm, key: CryptoKey, data: any): any;
|
||||
digest(algorithm: string, data: ArrayBufferView): any;
|
||||
digest(algorithm: Algorithm, data: ArrayBufferView): any;
|
||||
encrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any;
|
||||
encrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any;
|
||||
exportKey(format: string, key: CryptoKey): any;
|
||||
generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
generateKey(algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
importKey(format: string, keyData: any, algorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
importKey(format: string, keyData: any, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
sign(algorithm: string, key: CryptoKey, data: any): any;
|
||||
sign(algorithm: Algorithm, key: CryptoKey, data: any): any;
|
||||
unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
verify(algorithm: string, key: CryptoKey, signature: any, data: any): any;
|
||||
verify(algorithm: Algorithm, key: CryptoKey, signature: any, data: any): any;
|
||||
importKey(format: string, keyData: ArrayBufferView, algorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
importKey(format: string, keyData: ArrayBufferView, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
sign(algorithm: string, key: CryptoKey, data: ArrayBufferView): any;
|
||||
sign(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any;
|
||||
unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
verify(algorithm: string, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any;
|
||||
verify(algorithm: Algorithm, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any;
|
||||
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string): any;
|
||||
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: Algorithm): any;
|
||||
}
|
||||
@@ -13352,9 +13352,9 @@ interface WebGLRenderingContext {
|
||||
blendFunc(sfactor: number, dfactor: number): void;
|
||||
blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void;
|
||||
bufferData(target: number, size: number, usage: number): void;
|
||||
bufferData(target: number, size: ArrayBufferView, usage: number): void;
|
||||
bufferData(target: number, size: any, usage: number): void;
|
||||
bufferData(target: number, size: any, usage: number): void;
|
||||
bufferSubData(target: number, offset: number, data: any): void;
|
||||
bufferSubData(target: number, offset: number, data: ArrayBufferView): void;
|
||||
bufferSubData(target: number, offset: number, data: any): void;
|
||||
checkFramebufferStatus(target: number): number;
|
||||
clear(mask: number): void;
|
||||
@@ -13363,8 +13363,8 @@ interface WebGLRenderingContext {
|
||||
clearStencil(s: number): void;
|
||||
colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void;
|
||||
compileShader(shader: WebGLShader): void;
|
||||
compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: any): void;
|
||||
compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: any): void;
|
||||
compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void;
|
||||
compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void;
|
||||
copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void;
|
||||
copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void;
|
||||
createBuffer(): WebGLBuffer;
|
||||
@@ -13432,7 +13432,7 @@ interface WebGLRenderingContext {
|
||||
linkProgram(program: WebGLProgram): void;
|
||||
pixelStorei(pname: number, param: number): void;
|
||||
polygonOffset(factor: number, units: number): void;
|
||||
readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: any): void;
|
||||
readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void;
|
||||
renderbufferStorage(target: number, internalformat: number, width: number, height: number): void;
|
||||
sampleCoverage(value: number, invert: boolean): void;
|
||||
scissor(x: number, y: number, width: number, height: number): void;
|
||||
@@ -14856,7 +14856,7 @@ interface NodeSelector {
|
||||
}
|
||||
|
||||
interface RandomSource {
|
||||
getRandomValues(array: any): any;
|
||||
getRandomValues(array: ArrayBufferView): ArrayBufferView;
|
||||
}
|
||||
|
||||
interface SVGAnimatedPathData {
|
||||
|
||||
Vendored
+25
-25
@@ -561,7 +561,7 @@ interface Math {
|
||||
*/
|
||||
atan(x: number): number;
|
||||
/**
|
||||
* Returns the angle (in radians) from the X axis to a point (y,x).
|
||||
* Returns the angle (in radians) from the X axis to a point.
|
||||
* @param y A numeric expression representing the cartesian y-coordinate.
|
||||
* @param x A numeric expression representing the cartesian x-coordinate.
|
||||
*/
|
||||
@@ -1628,7 +1628,7 @@ interface IteratorResult<T> {
|
||||
}
|
||||
|
||||
interface Iterator<T> {
|
||||
next(): IteratorResult<T>;
|
||||
next(value?: any): IteratorResult<T>;
|
||||
return?(value?: any): IteratorResult<T>;
|
||||
throw?(e?: any): IteratorResult<T>;
|
||||
}
|
||||
@@ -15356,7 +15356,7 @@ interface SourceBuffer extends EventTarget {
|
||||
videoTracks: VideoTrackList;
|
||||
abort(): void;
|
||||
appendBuffer(data: ArrayBuffer): void;
|
||||
appendBuffer(data: any): void;
|
||||
appendBuffer(data: ArrayBufferView): void;
|
||||
appendStream(stream: MSStream, maxSize?: number): void;
|
||||
remove(start: number, end: number): void;
|
||||
}
|
||||
@@ -15464,31 +15464,31 @@ declare var StyleSheetPageList: {
|
||||
}
|
||||
|
||||
interface SubtleCrypto {
|
||||
decrypt(algorithm: string, key: CryptoKey, data: any): any;
|
||||
decrypt(algorithm: Algorithm, key: CryptoKey, data: any): any;
|
||||
decrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any;
|
||||
decrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any;
|
||||
deriveBits(algorithm: string, baseKey: CryptoKey, length: number): any;
|
||||
deriveBits(algorithm: Algorithm, baseKey: CryptoKey, length: number): any;
|
||||
deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any;
|
||||
deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any;
|
||||
deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
digest(algorithm: string, data: any): any;
|
||||
digest(algorithm: Algorithm, data: any): any;
|
||||
encrypt(algorithm: string, key: CryptoKey, data: any): any;
|
||||
encrypt(algorithm: Algorithm, key: CryptoKey, data: any): any;
|
||||
digest(algorithm: string, data: ArrayBufferView): any;
|
||||
digest(algorithm: Algorithm, data: ArrayBufferView): any;
|
||||
encrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any;
|
||||
encrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any;
|
||||
exportKey(format: string, key: CryptoKey): any;
|
||||
generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
generateKey(algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
importKey(format: string, keyData: any, algorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
importKey(format: string, keyData: any, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
sign(algorithm: string, key: CryptoKey, data: any): any;
|
||||
sign(algorithm: Algorithm, key: CryptoKey, data: any): any;
|
||||
unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
verify(algorithm: string, key: CryptoKey, signature: any, data: any): any;
|
||||
verify(algorithm: Algorithm, key: CryptoKey, signature: any, data: any): any;
|
||||
importKey(format: string, keyData: ArrayBufferView, algorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
importKey(format: string, keyData: ArrayBufferView, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
sign(algorithm: string, key: CryptoKey, data: ArrayBufferView): any;
|
||||
sign(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any;
|
||||
unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any;
|
||||
unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any;
|
||||
verify(algorithm: string, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any;
|
||||
verify(algorithm: Algorithm, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any;
|
||||
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string): any;
|
||||
wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: Algorithm): any;
|
||||
}
|
||||
@@ -16000,9 +16000,9 @@ interface WebGLRenderingContext {
|
||||
blendFunc(sfactor: number, dfactor: number): void;
|
||||
blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void;
|
||||
bufferData(target: number, size: number, usage: number): void;
|
||||
bufferData(target: number, size: ArrayBufferView, usage: number): void;
|
||||
bufferData(target: number, size: any, usage: number): void;
|
||||
bufferData(target: number, size: any, usage: number): void;
|
||||
bufferSubData(target: number, offset: number, data: any): void;
|
||||
bufferSubData(target: number, offset: number, data: ArrayBufferView): void;
|
||||
bufferSubData(target: number, offset: number, data: any): void;
|
||||
checkFramebufferStatus(target: number): number;
|
||||
clear(mask: number): void;
|
||||
@@ -16011,8 +16011,8 @@ interface WebGLRenderingContext {
|
||||
clearStencil(s: number): void;
|
||||
colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void;
|
||||
compileShader(shader: WebGLShader): void;
|
||||
compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: any): void;
|
||||
compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: any): void;
|
||||
compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void;
|
||||
compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void;
|
||||
copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void;
|
||||
copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void;
|
||||
createBuffer(): WebGLBuffer;
|
||||
@@ -16080,7 +16080,7 @@ interface WebGLRenderingContext {
|
||||
linkProgram(program: WebGLProgram): void;
|
||||
pixelStorei(pname: number, param: number): void;
|
||||
polygonOffset(factor: number, units: number): void;
|
||||
readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: any): void;
|
||||
readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void;
|
||||
renderbufferStorage(target: number, internalformat: number, width: number, height: number): void;
|
||||
sampleCoverage(value: number, invert: boolean): void;
|
||||
scissor(x: number, y: number, width: number, height: number): void;
|
||||
@@ -17504,7 +17504,7 @@ interface NodeSelector {
|
||||
}
|
||||
|
||||
interface RandomSource {
|
||||
getRandomValues(array: any): any;
|
||||
getRandomValues(array: ArrayBufferView): ArrayBufferView;
|
||||
}
|
||||
|
||||
interface SVGAnimatedPathData {
|
||||
|
||||
+189
-124
@@ -275,6 +275,17 @@ var ts;
|
||||
return result;
|
||||
}
|
||||
ts.arrayToMap = arrayToMap;
|
||||
function memoize(callback) {
|
||||
var value;
|
||||
return function () {
|
||||
if (callback) {
|
||||
value = callback();
|
||||
callback = undefined;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
}
|
||||
ts.memoize = memoize;
|
||||
function formatStringFromArgs(text, args, baseIndex) {
|
||||
baseIndex = baseIndex || 0;
|
||||
return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; });
|
||||
@@ -1064,7 +1075,7 @@ var ts;
|
||||
Line_terminator_not_permitted_before_arrow: { code: 1200, category: ts.DiagnosticCategory.Error, key: "Line terminator not permitted before arrow." },
|
||||
Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_or_import_d_from_mod_instead: { code: 1202, category: ts.DiagnosticCategory.Error, key: "Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"' or 'import d from \"mod\"' instead." },
|
||||
Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead: { code: 1203, category: ts.DiagnosticCategory.Error, key: "Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead." },
|
||||
Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile external modules into amd or commonjs when targeting es6 or higher." },
|
||||
Cannot_compile_external_modules_into_amd_commonjs_or_umd_when_targeting_ES6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile external modules into 'amd', 'commonjs' or 'umd' when targeting 'ES6' or higher." },
|
||||
Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: ts.DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." },
|
||||
Decorators_are_not_valid_here: { code: 1206, category: ts.DiagnosticCategory.Error, key: "Decorators are not valid here." },
|
||||
Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: ts.DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." },
|
||||
@@ -1366,7 +1377,7 @@ var ts;
|
||||
Do_not_emit_comments_to_output: { code: 6009, category: ts.DiagnosticCategory.Message, key: "Do not emit comments to output." },
|
||||
Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do not emit outputs." },
|
||||
Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" },
|
||||
Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs' or 'amd'" },
|
||||
Specify_module_code_generation_Colon_commonjs_amd_or_umd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs', 'amd', or 'umd'." },
|
||||
Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print this message." },
|
||||
Print_the_compiler_s_version: { code: 6019, category: ts.DiagnosticCategory.Message, key: "Print the compiler's version." },
|
||||
Compile_the_project_in_the_given_directory: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile the project in the given directory." },
|
||||
@@ -1387,8 +1398,8 @@ var ts;
|
||||
Generates_corresponding_map_file: { code: 6043, category: ts.DiagnosticCategory.Message, key: "Generates corresponding '.map' file." },
|
||||
Compiler_option_0_expects_an_argument: { code: 6044, category: ts.DiagnosticCategory.Error, key: "Compiler option '{0}' expects an argument." },
|
||||
Unterminated_quoted_string_in_response_file_0: { code: 6045, category: ts.DiagnosticCategory.Error, key: "Unterminated quoted string in response file '{0}'." },
|
||||
Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs' or 'amd'." },
|
||||
Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." },
|
||||
Argument_for_module_option_must_be_commonjs_amd_or_umd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs', 'amd', or 'umd'." },
|
||||
Argument_for_target_option_must_be_ES3_ES5_or_ES6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'." },
|
||||
Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: ts.DiagnosticCategory.Error, key: "Locale must be of the form <language> or <language>-<territory>. For example '{0}' or '{1}'." },
|
||||
Unsupported_locale_0: { code: 6049, category: ts.DiagnosticCategory.Error, key: "Unsupported locale '{0}'." },
|
||||
Unable_to_open_file_0: { code: 6050, category: ts.DiagnosticCategory.Error, key: "Unable to open file '{0}'." },
|
||||
@@ -1399,6 +1410,8 @@ var ts;
|
||||
Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: ts.DiagnosticCategory.Message, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." },
|
||||
Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: ts.DiagnosticCategory.Message, key: "Do not emit declarations for code that has an '@internal' annotation." },
|
||||
Preserve_new_lines_when_emitting_code: { code: 6057, category: ts.DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." },
|
||||
Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: ts.DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." },
|
||||
File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { code: 6059, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files." },
|
||||
Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." },
|
||||
Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." },
|
||||
Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." },
|
||||
@@ -1686,7 +1699,7 @@ var ts;
|
||||
function isLineBreak(ch) {
|
||||
// ES5 7.3:
|
||||
// The ECMAScript line terminator characters are listed in Table 3.
|
||||
// Table 3 � Line Terminator Characters
|
||||
// Table 3: Line Terminator Characters
|
||||
// Code Unit Value Name Formal Name
|
||||
// \u000A Line Feed <LF>
|
||||
// \u000D Carriage Return <CR>
|
||||
@@ -2873,10 +2886,7 @@ var ts;
|
||||
parent = node;
|
||||
if (symbolKind & 262128) {
|
||||
container = node;
|
||||
if (lastContainer) {
|
||||
lastContainer.nextContainer = container;
|
||||
}
|
||||
lastContainer = container;
|
||||
addToContainerChain(container);
|
||||
}
|
||||
if (isBlockScopeContainer) {
|
||||
setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 227);
|
||||
@@ -2886,6 +2896,12 @@ var ts;
|
||||
parent = saveParent;
|
||||
blockScopeContainer = savedBlockScopeContainer;
|
||||
}
|
||||
function addToContainerChain(node) {
|
||||
if (lastContainer) {
|
||||
lastContainer.nextContainer = node;
|
||||
}
|
||||
lastContainer = node;
|
||||
}
|
||||
function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) {
|
||||
switch (container.kind) {
|
||||
case 205:
|
||||
@@ -3014,6 +3030,7 @@ var ts;
|
||||
default:
|
||||
if (!blockScopeContainer.locals) {
|
||||
blockScopeContainer.locals = {};
|
||||
addToContainerChain(blockScopeContainer);
|
||||
}
|
||||
declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes);
|
||||
}
|
||||
@@ -3806,7 +3823,7 @@ var ts;
|
||||
var forStatement = parent_1;
|
||||
return (forStatement.initializer === node && forStatement.initializer.kind !== 199) ||
|
||||
forStatement.condition === node ||
|
||||
forStatement.iterator === node;
|
||||
forStatement.incrementor === node;
|
||||
case 187:
|
||||
case 188:
|
||||
var forInStatement = parent_1;
|
||||
@@ -4903,7 +4920,7 @@ var ts;
|
||||
case 186:
|
||||
return visitNode(cbNode, node.initializer) ||
|
||||
visitNode(cbNode, node.condition) ||
|
||||
visitNode(cbNode, node.iterator) ||
|
||||
visitNode(cbNode, node.incrementor) ||
|
||||
visitNode(cbNode, node.statement);
|
||||
case 187:
|
||||
return visitNode(cbNode, node.initializer) ||
|
||||
@@ -7112,7 +7129,7 @@ var ts;
|
||||
}
|
||||
parseExpected(22);
|
||||
if (token !== 17) {
|
||||
forStatement.iterator = allowInAnd(parseExpression);
|
||||
forStatement.incrementor = allowInAnd(parseExpression);
|
||||
}
|
||||
parseExpected(17);
|
||||
forOrForInOrForOfStatement = forStatement;
|
||||
@@ -8514,11 +8531,10 @@ var ts;
|
||||
var globalESSymbolType;
|
||||
var globalIterableType;
|
||||
var anyArrayType;
|
||||
var globalTypedPropertyDescriptorType;
|
||||
var globalClassDecoratorType;
|
||||
var globalParameterDecoratorType;
|
||||
var globalPropertyDecoratorType;
|
||||
var globalMethodDecoratorType;
|
||||
var getGlobalClassDecoratorType;
|
||||
var getGlobalParameterDecoratorType;
|
||||
var getGlobalPropertyDecoratorType;
|
||||
var getGlobalMethodDecoratorType;
|
||||
var tupleTypes = {};
|
||||
var unionTypes = {};
|
||||
var stringLiteralTypes = {};
|
||||
@@ -10440,10 +10456,11 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getDeclaredTypeOfClass(symbol) {
|
||||
function getDeclaredTypeOfClassOrInterface(symbol) {
|
||||
var links = getSymbolLinks(symbol);
|
||||
if (!links.declaredType) {
|
||||
var type = links.declaredType = createObjectType(1024, symbol);
|
||||
var kind = symbol.flags & 32 ? 1024 : 2048;
|
||||
var type = links.declaredType = createObjectType(kind, symbol);
|
||||
var typeParameters = getTypeParametersOfClassOrInterface(symbol);
|
||||
if (typeParameters) {
|
||||
type.flags |= 4096;
|
||||
@@ -10453,32 +10470,6 @@ var ts;
|
||||
type.target = type;
|
||||
type.typeArguments = type.typeParameters;
|
||||
}
|
||||
type.declaredProperties = getNamedMembers(symbol.members);
|
||||
type.declaredCallSignatures = emptyArray;
|
||||
type.declaredConstructSignatures = emptyArray;
|
||||
type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0);
|
||||
type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1);
|
||||
}
|
||||
return links.declaredType;
|
||||
}
|
||||
function getDeclaredTypeOfInterface(symbol) {
|
||||
var links = getSymbolLinks(symbol);
|
||||
if (!links.declaredType) {
|
||||
var type = links.declaredType = createObjectType(2048, symbol);
|
||||
var typeParameters = getTypeParametersOfClassOrInterface(symbol);
|
||||
if (typeParameters) {
|
||||
type.flags |= 4096;
|
||||
type.typeParameters = typeParameters;
|
||||
type.instantiations = {};
|
||||
type.instantiations[getTypeListId(type.typeParameters)] = type;
|
||||
type.target = type;
|
||||
type.typeArguments = type.typeParameters;
|
||||
}
|
||||
type.declaredProperties = getNamedMembers(symbol.members);
|
||||
type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]);
|
||||
type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]);
|
||||
type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0);
|
||||
type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1);
|
||||
}
|
||||
return links.declaredType;
|
||||
}
|
||||
@@ -10529,11 +10520,8 @@ var ts;
|
||||
}
|
||||
function getDeclaredTypeOfSymbol(symbol) {
|
||||
ts.Debug.assert((symbol.flags & 16777216) === 0);
|
||||
if (symbol.flags & 32) {
|
||||
return getDeclaredTypeOfClass(symbol);
|
||||
}
|
||||
if (symbol.flags & 64) {
|
||||
return getDeclaredTypeOfInterface(symbol);
|
||||
if (symbol.flags & (32 | 64)) {
|
||||
return getDeclaredTypeOfClassOrInterface(symbol);
|
||||
}
|
||||
if (symbol.flags & 524288) {
|
||||
return getDeclaredTypeOfTypeAlias(symbol);
|
||||
@@ -10581,15 +10569,27 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function resolveDeclaredMembers(type) {
|
||||
if (!type.declaredProperties) {
|
||||
var symbol = type.symbol;
|
||||
type.declaredProperties = getNamedMembers(symbol.members);
|
||||
type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]);
|
||||
type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]);
|
||||
type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0);
|
||||
type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
function resolveClassOrInterfaceMembers(type) {
|
||||
var members = type.symbol.members;
|
||||
var callSignatures = type.declaredCallSignatures;
|
||||
var constructSignatures = type.declaredConstructSignatures;
|
||||
var stringIndexType = type.declaredStringIndexType;
|
||||
var numberIndexType = type.declaredNumberIndexType;
|
||||
var baseTypes = getBaseTypes(type);
|
||||
var target = resolveDeclaredMembers(type);
|
||||
var members = target.symbol.members;
|
||||
var callSignatures = target.declaredCallSignatures;
|
||||
var constructSignatures = target.declaredConstructSignatures;
|
||||
var stringIndexType = target.declaredStringIndexType;
|
||||
var numberIndexType = target.declaredNumberIndexType;
|
||||
var baseTypes = getBaseTypes(target);
|
||||
if (baseTypes.length) {
|
||||
members = createSymbolTable(type.declaredProperties);
|
||||
members = createSymbolTable(target.declaredProperties);
|
||||
for (var _i = 0; _i < baseTypes.length; _i++) {
|
||||
var baseType = baseTypes[_i];
|
||||
addInheritedMembers(members, getPropertiesOfObjectType(baseType));
|
||||
@@ -10602,7 +10602,7 @@ var ts;
|
||||
setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType);
|
||||
}
|
||||
function resolveTypeReferenceMembers(type) {
|
||||
var target = type.target;
|
||||
var target = resolveDeclaredMembers(type.target);
|
||||
var mapper = createTypeMapper(target.typeParameters, type.typeArguments);
|
||||
var members = createInstantiatedSymbolTable(target.declaredProperties, mapper);
|
||||
var callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature);
|
||||
@@ -10740,7 +10740,7 @@ var ts;
|
||||
callSignatures = getSignaturesOfSymbol(symbol);
|
||||
}
|
||||
if (symbol.flags & 32) {
|
||||
var classType = getDeclaredTypeOfClass(symbol);
|
||||
var classType = getDeclaredTypeOfClassOrInterface(symbol);
|
||||
constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]);
|
||||
if (!constructSignatures.length) {
|
||||
constructSignatures = getDefaultConstructSignatures(classType);
|
||||
@@ -10841,7 +10841,7 @@ var ts;
|
||||
var type = getApparentType(current);
|
||||
if (type !== unknownType) {
|
||||
var prop = getPropertyOfType(type, name);
|
||||
if (!prop) {
|
||||
if (!prop || getDeclarationFlagsFromSymbol(prop) & (32 | 64)) {
|
||||
return undefined;
|
||||
}
|
||||
if (!props) {
|
||||
@@ -10951,7 +10951,7 @@ var ts;
|
||||
function getSignatureFromDeclaration(declaration) {
|
||||
var links = getNodeLinks(declaration);
|
||||
if (!links.resolvedSignature) {
|
||||
var classType = declaration.kind === 135 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined;
|
||||
var classType = declaration.kind === 135 ? getDeclaredTypeOfClassOrInterface(declaration.parent.symbol) : undefined;
|
||||
var typeParameters = classType ? classType.typeParameters :
|
||||
declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined;
|
||||
var parameters = [];
|
||||
@@ -11553,7 +11553,7 @@ var ts;
|
||||
return type;
|
||||
}
|
||||
function combineTypeMappers(mapper1, mapper2) {
|
||||
return function (t) { return mapper2(mapper1(t)); };
|
||||
return function (t) { return instantiateType(mapper1(t), mapper2); };
|
||||
}
|
||||
function instantiateTypeParameter(typeParameter, mapper) {
|
||||
var result = createType(512);
|
||||
@@ -15407,21 +15407,21 @@ var ts;
|
||||
case 201:
|
||||
var classSymbol = getSymbolOfNode(node.parent);
|
||||
var classConstructorType = getTypeOfSymbol(classSymbol);
|
||||
var classDecoratorType = instantiateSingleCallFunctionType(globalClassDecoratorType, [classConstructorType]);
|
||||
var classDecoratorType = instantiateSingleCallFunctionType(getGlobalClassDecoratorType(), [classConstructorType]);
|
||||
checkTypeAssignableTo(exprType, classDecoratorType, node);
|
||||
break;
|
||||
case 132:
|
||||
checkTypeAssignableTo(exprType, globalPropertyDecoratorType, node);
|
||||
checkTypeAssignableTo(exprType, getGlobalPropertyDecoratorType(), node);
|
||||
break;
|
||||
case 134:
|
||||
case 136:
|
||||
case 137:
|
||||
var methodType = getTypeOfNode(node.parent);
|
||||
var methodDecoratorType = instantiateSingleCallFunctionType(globalMethodDecoratorType, [methodType]);
|
||||
var methodDecoratorType = instantiateSingleCallFunctionType(getGlobalMethodDecoratorType(), [methodType]);
|
||||
checkTypeAssignableTo(exprType, methodDecoratorType, node);
|
||||
break;
|
||||
case 129:
|
||||
checkTypeAssignableTo(exprType, globalParameterDecoratorType, node);
|
||||
checkTypeAssignableTo(exprType, getGlobalParameterDecoratorType(), node);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -15804,8 +15804,8 @@ var ts;
|
||||
}
|
||||
if (node.condition)
|
||||
checkExpression(node.condition);
|
||||
if (node.iterator)
|
||||
checkExpression(node.iterator);
|
||||
if (node.incrementor)
|
||||
checkExpression(node.incrementor);
|
||||
checkSourceElement(node.statement);
|
||||
}
|
||||
function checkForOfStatement(node) {
|
||||
@@ -16385,7 +16385,7 @@ var ts;
|
||||
return true;
|
||||
}
|
||||
var seen = {};
|
||||
ts.forEach(type.declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; });
|
||||
ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; });
|
||||
var ok = true;
|
||||
for (var _i = 0; _i < baseTypes.length; _i++) {
|
||||
var base = baseTypes[_i];
|
||||
@@ -17880,11 +17880,10 @@ var ts;
|
||||
globalNumberType = getGlobalType("Number");
|
||||
globalBooleanType = getGlobalType("Boolean");
|
||||
globalRegExpType = getGlobalType("RegExp");
|
||||
globalTypedPropertyDescriptorType = getTypeOfGlobalSymbol(getGlobalTypeSymbol("TypedPropertyDescriptor"), 1);
|
||||
globalClassDecoratorType = getGlobalType("ClassDecorator");
|
||||
globalPropertyDecoratorType = getGlobalType("PropertyDecorator");
|
||||
globalMethodDecoratorType = getGlobalType("MethodDecorator");
|
||||
globalParameterDecoratorType = getGlobalType("ParameterDecorator");
|
||||
getGlobalClassDecoratorType = ts.memoize(function () { return getGlobalType("ClassDecorator"); });
|
||||
getGlobalPropertyDecoratorType = ts.memoize(function () { return getGlobalType("PropertyDecorator"); });
|
||||
getGlobalMethodDecoratorType = ts.memoize(function () { return getGlobalType("MethodDecorator"); });
|
||||
getGlobalParameterDecoratorType = ts.memoize(function () { return getGlobalType("ParameterDecorator"); });
|
||||
if (languageVersion >= 2) {
|
||||
globalTemplateStringsArrayType = getGlobalType("TemplateStringsArray");
|
||||
globalESSymbolType = getGlobalType("Symbol");
|
||||
@@ -20156,9 +20155,9 @@ var ts;
|
||||
ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile;
|
||||
function emitFiles(resolver, host, targetSourceFile) {
|
||||
var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};";
|
||||
var decorateHelper = "\nvar __decorate = this.__decorate || (typeof Reflect === \"object\" && Reflect.decorate) || function (decorators, target, key, desc) {\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
|
||||
var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };";
|
||||
var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };";
|
||||
var decorateHelper = "\nif (typeof __decorate !== \"function\") __decorate = function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
|
||||
var metadataHelper = "\nif (typeof __metadata !== \"function\") __metadata = function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};";
|
||||
var paramHelper = "\nif (typeof __param !== \"function\") __param = function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};";
|
||||
var compilerOptions = host.getCompilerOptions();
|
||||
var languageVersion = compilerOptions.target || 0;
|
||||
var sourceMapDataList = compilerOptions.sourceMap ? [] : undefined;
|
||||
@@ -21773,7 +21772,7 @@ var ts;
|
||||
write(";");
|
||||
emitOptional(" ", node.condition);
|
||||
write(";");
|
||||
emitOptional(" ", node.iterator);
|
||||
emitOptional(" ", node.incrementor);
|
||||
write(")");
|
||||
emitEmbeddedStatement(node.statement);
|
||||
}
|
||||
@@ -23811,8 +23810,18 @@ var ts;
|
||||
write("}");
|
||||
}
|
||||
}
|
||||
function emitAMDModule(node, startIndex) {
|
||||
collectExternalModuleInfo(node);
|
||||
function emitAMDDependencies(node, includeNonAmdDependencies) {
|
||||
// An AMD define function has the following shape:
|
||||
// define(id?, dependencies?, factory);
|
||||
//
|
||||
// This has the shape of
|
||||
// define(name, ["module1", "module2"], function (module1Alias) {
|
||||
// The location of the alias in the parameter list in the factory function needs to
|
||||
// match the position of the module name in the dependency list.
|
||||
//
|
||||
// To ensure this is true in cases of modules with no aliases, e.g.:
|
||||
// `import "module"` or `<amd-dependency path= "a.css" />`
|
||||
// we need to add modules without alias names to the end of the dependencies list
|
||||
var aliasedModuleNames = [];
|
||||
var unaliasedModuleNames = [];
|
||||
var importAliasNames = [];
|
||||
@@ -23841,7 +23850,7 @@ var ts;
|
||||
else {
|
||||
importAliasName = getGeneratedNameForNode(importNode);
|
||||
}
|
||||
if (importAliasName) {
|
||||
if (includeNonAmdDependencies && importAliasName) {
|
||||
aliasedModuleNames.push(externalModuleName);
|
||||
importAliasNames.push(importAliasName);
|
||||
}
|
||||
@@ -23849,11 +23858,6 @@ var ts;
|
||||
unaliasedModuleNames.push(externalModuleName);
|
||||
}
|
||||
}
|
||||
writeLine();
|
||||
write("define(");
|
||||
if (node.amdModuleName) {
|
||||
write("\"" + node.amdModuleName + "\", ");
|
||||
}
|
||||
write("[\"require\", \"exports\"");
|
||||
if (aliasedModuleNames.length) {
|
||||
write(", ");
|
||||
@@ -23868,6 +23872,15 @@ var ts;
|
||||
write(", ");
|
||||
write(importAliasNames.join(", "));
|
||||
}
|
||||
}
|
||||
function emitAMDModule(node, startIndex) {
|
||||
collectExternalModuleInfo(node);
|
||||
writeLine();
|
||||
write("define(");
|
||||
if (node.amdModuleName) {
|
||||
write("\"" + node.amdModuleName + "\", ");
|
||||
}
|
||||
emitAMDDependencies(node, true);
|
||||
write(") {");
|
||||
increaseIndent();
|
||||
emitExportStarHelper();
|
||||
@@ -23887,6 +23900,21 @@ var ts;
|
||||
emitTempDeclarations(true);
|
||||
emitExportEquals(false);
|
||||
}
|
||||
function emitUMDModule(node, startIndex) {
|
||||
collectExternalModuleInfo(node);
|
||||
writeLines("(function (deps, factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define(deps, factory);\n }\n})(");
|
||||
emitAMDDependencies(node, false);
|
||||
write(") {");
|
||||
increaseIndent();
|
||||
emitExportStarHelper();
|
||||
emitCaptureThisForNodeIfNecessary(node);
|
||||
emitLinesStartingAt(node.statements, startIndex);
|
||||
emitTempDeclarations(true);
|
||||
emitExportEquals(true);
|
||||
decreaseIndent();
|
||||
writeLine();
|
||||
write("});");
|
||||
}
|
||||
function emitES6Module(node, startIndex) {
|
||||
externalImports = undefined;
|
||||
exportSpecifiers = undefined;
|
||||
@@ -23956,6 +23984,9 @@ var ts;
|
||||
else if (compilerOptions.module === 2) {
|
||||
emitAMDModule(node, startIndex);
|
||||
}
|
||||
else if (compilerOptions.module === 3) {
|
||||
emitUMDModule(node, startIndex);
|
||||
}
|
||||
else {
|
||||
emitCommonJSModule(node, startIndex);
|
||||
}
|
||||
@@ -24441,7 +24472,7 @@ var ts;
|
||||
getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker,
|
||||
getCommonSourceDirectory: function () { return commonSourceDirectory; },
|
||||
emit: emit,
|
||||
getCurrentDirectory: host.getCurrentDirectory,
|
||||
getCurrentDirectory: function () { return host.getCurrentDirectory(); },
|
||||
getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); },
|
||||
getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); },
|
||||
getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); },
|
||||
@@ -24450,14 +24481,14 @@ var ts;
|
||||
return program;
|
||||
function getEmitHost(writeFileCallback) {
|
||||
return {
|
||||
getCanonicalFileName: host.getCanonicalFileName,
|
||||
getCanonicalFileName: function (fileName) { return host.getCanonicalFileName(fileName); },
|
||||
getCommonSourceDirectory: program.getCommonSourceDirectory,
|
||||
getCompilerOptions: program.getCompilerOptions,
|
||||
getCurrentDirectory: host.getCurrentDirectory,
|
||||
getNewLine: host.getNewLine,
|
||||
getCurrentDirectory: function () { return host.getCurrentDirectory(); },
|
||||
getNewLine: function () { return host.getNewLine(); },
|
||||
getSourceFile: program.getSourceFile,
|
||||
getSourceFiles: program.getSourceFiles,
|
||||
writeFile: writeFileCallback || host.writeFile
|
||||
writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); })
|
||||
};
|
||||
}
|
||||
function getDiagnosticsProducingTypeChecker() {
|
||||
@@ -24663,6 +24694,53 @@ var ts;
|
||||
return findSourceFile(fileName, false, file, nameLiteral.pos, nameLiteral.end - nameLiteral.pos);
|
||||
}
|
||||
}
|
||||
function computeCommonSourceDirectory(sourceFiles) {
|
||||
var commonPathComponents;
|
||||
var currentDirectory = host.getCurrentDirectory();
|
||||
ts.forEach(files, function (sourceFile) {
|
||||
if (ts.isDeclarationFile(sourceFile)) {
|
||||
return;
|
||||
}
|
||||
var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, currentDirectory);
|
||||
sourcePathComponents.pop();
|
||||
if (!commonPathComponents) {
|
||||
commonPathComponents = sourcePathComponents;
|
||||
return;
|
||||
}
|
||||
for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) {
|
||||
if (commonPathComponents[i] !== sourcePathComponents[i]) {
|
||||
if (i === 0) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files));
|
||||
return;
|
||||
}
|
||||
commonPathComponents.length = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sourcePathComponents.length < commonPathComponents.length) {
|
||||
commonPathComponents.length = sourcePathComponents.length;
|
||||
}
|
||||
});
|
||||
return ts.getNormalizedPathFromPathComponents(commonPathComponents);
|
||||
}
|
||||
function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) {
|
||||
var allFilesBelongToPath = true;
|
||||
if (sourceFiles) {
|
||||
var currentDirectory = host.getCurrentDirectory();
|
||||
var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory));
|
||||
for (var _i = 0; _i < sourceFiles.length; _i++) {
|
||||
var sourceFile = sourceFiles[_i];
|
||||
if (!ts.isDeclarationFile(sourceFile)) {
|
||||
var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory));
|
||||
if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, sourceFile.fileName, options.rootDir));
|
||||
allFilesBelongToPath = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return allFilesBelongToPath;
|
||||
}
|
||||
function verifyCompilerOptions() {
|
||||
if (options.separateCompilation) {
|
||||
if (options.sourceMap) {
|
||||
@@ -24704,40 +24782,19 @@ var ts;
|
||||
diagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided));
|
||||
}
|
||||
if (options.module && languageVersion >= 2) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_commonjs_or_umd_when_targeting_ES6_or_higher));
|
||||
}
|
||||
if (options.outDir ||
|
||||
options.sourceRoot ||
|
||||
(options.mapRoot &&
|
||||
(!options.out || firstExternalModuleSourceFile !== undefined))) {
|
||||
var commonPathComponents;
|
||||
ts.forEach(files, function (sourceFile) {
|
||||
if (!(sourceFile.flags & 2048)
|
||||
&& !ts.fileExtensionIs(sourceFile.fileName, ".js")) {
|
||||
var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory());
|
||||
sourcePathComponents.pop();
|
||||
if (commonPathComponents) {
|
||||
for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) {
|
||||
if (commonPathComponents[i] !== sourcePathComponents[i]) {
|
||||
if (i === 0) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files));
|
||||
return;
|
||||
}
|
||||
commonPathComponents.length = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sourcePathComponents.length < commonPathComponents.length) {
|
||||
commonPathComponents.length = sourcePathComponents.length;
|
||||
}
|
||||
}
|
||||
else {
|
||||
commonPathComponents = sourcePathComponents;
|
||||
}
|
||||
}
|
||||
});
|
||||
commonSourceDirectory = ts.getNormalizedPathFromPathComponents(commonPathComponents);
|
||||
if (commonSourceDirectory) {
|
||||
if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) {
|
||||
commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, host.getCurrentDirectory());
|
||||
}
|
||||
else {
|
||||
commonSourceDirectory = computeCommonSourceDirectory(files);
|
||||
}
|
||||
if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) {
|
||||
commonSourceDirectory += ts.directorySeparator;
|
||||
}
|
||||
}
|
||||
@@ -24804,11 +24861,12 @@ var ts;
|
||||
shortName: "m",
|
||||
type: {
|
||||
"commonjs": 1,
|
||||
"amd": 2
|
||||
"amd": 2,
|
||||
"umd": 3
|
||||
},
|
||||
description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_or_amd,
|
||||
description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_or_umd,
|
||||
paramType: ts.Diagnostics.KIND,
|
||||
error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd
|
||||
error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_amd_or_umd
|
||||
},
|
||||
{
|
||||
name: "noEmit",
|
||||
@@ -24864,6 +24922,13 @@ var ts;
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Do_not_emit_comments_to_output
|
||||
},
|
||||
{
|
||||
name: "rootDir",
|
||||
type: "string",
|
||||
isFilePath: true,
|
||||
description: ts.Diagnostics.Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir,
|
||||
paramType: ts.Diagnostics.LOCATION
|
||||
},
|
||||
{
|
||||
name: "separateCompilation",
|
||||
type: "boolean"
|
||||
@@ -24897,7 +24962,7 @@ var ts;
|
||||
type: { "es3": 0, "es5": 1, "es6": 2 },
|
||||
description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental,
|
||||
paramType: ts.Diagnostics.VERSION,
|
||||
error: ts.Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6
|
||||
error: ts.Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6
|
||||
},
|
||||
{
|
||||
name: "version",
|
||||
|
||||
+196
-128
@@ -275,6 +275,17 @@ var ts;
|
||||
return result;
|
||||
}
|
||||
ts.arrayToMap = arrayToMap;
|
||||
function memoize(callback) {
|
||||
var value;
|
||||
return function () {
|
||||
if (callback) {
|
||||
value = callback();
|
||||
callback = undefined;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
}
|
||||
ts.memoize = memoize;
|
||||
function formatStringFromArgs(text, args, baseIndex) {
|
||||
baseIndex = baseIndex || 0;
|
||||
return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; });
|
||||
@@ -1064,7 +1075,7 @@ var ts;
|
||||
Line_terminator_not_permitted_before_arrow: { code: 1200, category: ts.DiagnosticCategory.Error, key: "Line terminator not permitted before arrow." },
|
||||
Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_or_import_d_from_mod_instead: { code: 1202, category: ts.DiagnosticCategory.Error, key: "Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"' or 'import d from \"mod\"' instead." },
|
||||
Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead: { code: 1203, category: ts.DiagnosticCategory.Error, key: "Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead." },
|
||||
Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile external modules into amd or commonjs when targeting es6 or higher." },
|
||||
Cannot_compile_external_modules_into_amd_commonjs_or_umd_when_targeting_ES6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile external modules into 'amd', 'commonjs' or 'umd' when targeting 'ES6' or higher." },
|
||||
Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: ts.DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." },
|
||||
Decorators_are_not_valid_here: { code: 1206, category: ts.DiagnosticCategory.Error, key: "Decorators are not valid here." },
|
||||
Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: ts.DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." },
|
||||
@@ -1366,7 +1377,7 @@ var ts;
|
||||
Do_not_emit_comments_to_output: { code: 6009, category: ts.DiagnosticCategory.Message, key: "Do not emit comments to output." },
|
||||
Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do not emit outputs." },
|
||||
Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" },
|
||||
Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs' or 'amd'" },
|
||||
Specify_module_code_generation_Colon_commonjs_amd_or_umd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs', 'amd', or 'umd'." },
|
||||
Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print this message." },
|
||||
Print_the_compiler_s_version: { code: 6019, category: ts.DiagnosticCategory.Message, key: "Print the compiler's version." },
|
||||
Compile_the_project_in_the_given_directory: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile the project in the given directory." },
|
||||
@@ -1387,8 +1398,8 @@ var ts;
|
||||
Generates_corresponding_map_file: { code: 6043, category: ts.DiagnosticCategory.Message, key: "Generates corresponding '.map' file." },
|
||||
Compiler_option_0_expects_an_argument: { code: 6044, category: ts.DiagnosticCategory.Error, key: "Compiler option '{0}' expects an argument." },
|
||||
Unterminated_quoted_string_in_response_file_0: { code: 6045, category: ts.DiagnosticCategory.Error, key: "Unterminated quoted string in response file '{0}'." },
|
||||
Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs' or 'amd'." },
|
||||
Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." },
|
||||
Argument_for_module_option_must_be_commonjs_amd_or_umd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs', 'amd', or 'umd'." },
|
||||
Argument_for_target_option_must_be_ES3_ES5_or_ES6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'." },
|
||||
Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: ts.DiagnosticCategory.Error, key: "Locale must be of the form <language> or <language>-<territory>. For example '{0}' or '{1}'." },
|
||||
Unsupported_locale_0: { code: 6049, category: ts.DiagnosticCategory.Error, key: "Unsupported locale '{0}'." },
|
||||
Unable_to_open_file_0: { code: 6050, category: ts.DiagnosticCategory.Error, key: "Unable to open file '{0}'." },
|
||||
@@ -1399,6 +1410,8 @@ var ts;
|
||||
Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: ts.DiagnosticCategory.Message, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." },
|
||||
Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: ts.DiagnosticCategory.Message, key: "Do not emit declarations for code that has an '@internal' annotation." },
|
||||
Preserve_new_lines_when_emitting_code: { code: 6057, category: ts.DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." },
|
||||
Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: ts.DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." },
|
||||
File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { code: 6059, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files." },
|
||||
Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." },
|
||||
Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." },
|
||||
Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." },
|
||||
@@ -1686,7 +1699,7 @@ var ts;
|
||||
function isLineBreak(ch) {
|
||||
// ES5 7.3:
|
||||
// The ECMAScript line terminator characters are listed in Table 3.
|
||||
// Table 3 � Line Terminator Characters
|
||||
// Table 3: Line Terminator Characters
|
||||
// Code Unit Value Name Formal Name
|
||||
// \u000A Line Feed <LF>
|
||||
// \u000D Carriage Return <CR>
|
||||
@@ -2736,11 +2749,12 @@ var ts;
|
||||
shortName: "m",
|
||||
type: {
|
||||
"commonjs": 1,
|
||||
"amd": 2
|
||||
"amd": 2,
|
||||
"umd": 3
|
||||
},
|
||||
description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_or_amd,
|
||||
description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_or_umd,
|
||||
paramType: ts.Diagnostics.KIND,
|
||||
error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd
|
||||
error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_amd_or_umd
|
||||
},
|
||||
{
|
||||
name: "noEmit",
|
||||
@@ -2796,6 +2810,13 @@ var ts;
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Do_not_emit_comments_to_output
|
||||
},
|
||||
{
|
||||
name: "rootDir",
|
||||
type: "string",
|
||||
isFilePath: true,
|
||||
description: ts.Diagnostics.Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir,
|
||||
paramType: ts.Diagnostics.LOCATION
|
||||
},
|
||||
{
|
||||
name: "separateCompilation",
|
||||
type: "boolean"
|
||||
@@ -2829,7 +2850,7 @@ var ts;
|
||||
type: { "es3": 0, "es5": 1, "es6": 2 },
|
||||
description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental,
|
||||
paramType: ts.Diagnostics.VERSION,
|
||||
error: ts.Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6
|
||||
error: ts.Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6
|
||||
},
|
||||
{
|
||||
name: "version",
|
||||
@@ -3640,7 +3661,7 @@ var ts;
|
||||
var forStatement = parent_1;
|
||||
return (forStatement.initializer === node && forStatement.initializer.kind !== 199) ||
|
||||
forStatement.condition === node ||
|
||||
forStatement.iterator === node;
|
||||
forStatement.incrementor === node;
|
||||
case 187:
|
||||
case 188:
|
||||
var forInStatement = parent_1;
|
||||
@@ -4737,7 +4758,7 @@ var ts;
|
||||
case 186:
|
||||
return visitNode(cbNode, node.initializer) ||
|
||||
visitNode(cbNode, node.condition) ||
|
||||
visitNode(cbNode, node.iterator) ||
|
||||
visitNode(cbNode, node.incrementor) ||
|
||||
visitNode(cbNode, node.statement);
|
||||
case 187:
|
||||
return visitNode(cbNode, node.initializer) ||
|
||||
@@ -6946,7 +6967,7 @@ var ts;
|
||||
}
|
||||
parseExpected(22);
|
||||
if (token !== 17) {
|
||||
forStatement.iterator = allowInAnd(parseExpression);
|
||||
forStatement.incrementor = allowInAnd(parseExpression);
|
||||
}
|
||||
parseExpected(17);
|
||||
forOrForInOrForOfStatement = forStatement;
|
||||
@@ -8437,10 +8458,7 @@ var ts;
|
||||
parent = node;
|
||||
if (symbolKind & 262128) {
|
||||
container = node;
|
||||
if (lastContainer) {
|
||||
lastContainer.nextContainer = container;
|
||||
}
|
||||
lastContainer = container;
|
||||
addToContainerChain(container);
|
||||
}
|
||||
if (isBlockScopeContainer) {
|
||||
setBlockScopeContainer(node, (symbolKind & 255504) === 0 && node.kind !== 227);
|
||||
@@ -8450,6 +8468,12 @@ var ts;
|
||||
parent = saveParent;
|
||||
blockScopeContainer = savedBlockScopeContainer;
|
||||
}
|
||||
function addToContainerChain(node) {
|
||||
if (lastContainer) {
|
||||
lastContainer.nextContainer = node;
|
||||
}
|
||||
lastContainer = node;
|
||||
}
|
||||
function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) {
|
||||
switch (container.kind) {
|
||||
case 205:
|
||||
@@ -8578,6 +8602,7 @@ var ts;
|
||||
default:
|
||||
if (!blockScopeContainer.locals) {
|
||||
blockScopeContainer.locals = {};
|
||||
addToContainerChain(blockScopeContainer);
|
||||
}
|
||||
declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes);
|
||||
}
|
||||
@@ -8857,11 +8882,10 @@ var ts;
|
||||
var globalESSymbolType;
|
||||
var globalIterableType;
|
||||
var anyArrayType;
|
||||
var globalTypedPropertyDescriptorType;
|
||||
var globalClassDecoratorType;
|
||||
var globalParameterDecoratorType;
|
||||
var globalPropertyDecoratorType;
|
||||
var globalMethodDecoratorType;
|
||||
var getGlobalClassDecoratorType;
|
||||
var getGlobalParameterDecoratorType;
|
||||
var getGlobalPropertyDecoratorType;
|
||||
var getGlobalMethodDecoratorType;
|
||||
var tupleTypes = {};
|
||||
var unionTypes = {};
|
||||
var stringLiteralTypes = {};
|
||||
@@ -10783,10 +10807,11 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getDeclaredTypeOfClass(symbol) {
|
||||
function getDeclaredTypeOfClassOrInterface(symbol) {
|
||||
var links = getSymbolLinks(symbol);
|
||||
if (!links.declaredType) {
|
||||
var type = links.declaredType = createObjectType(1024, symbol);
|
||||
var kind = symbol.flags & 32 ? 1024 : 2048;
|
||||
var type = links.declaredType = createObjectType(kind, symbol);
|
||||
var typeParameters = getTypeParametersOfClassOrInterface(symbol);
|
||||
if (typeParameters) {
|
||||
type.flags |= 4096;
|
||||
@@ -10796,32 +10821,6 @@ var ts;
|
||||
type.target = type;
|
||||
type.typeArguments = type.typeParameters;
|
||||
}
|
||||
type.declaredProperties = getNamedMembers(symbol.members);
|
||||
type.declaredCallSignatures = emptyArray;
|
||||
type.declaredConstructSignatures = emptyArray;
|
||||
type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0);
|
||||
type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1);
|
||||
}
|
||||
return links.declaredType;
|
||||
}
|
||||
function getDeclaredTypeOfInterface(symbol) {
|
||||
var links = getSymbolLinks(symbol);
|
||||
if (!links.declaredType) {
|
||||
var type = links.declaredType = createObjectType(2048, symbol);
|
||||
var typeParameters = getTypeParametersOfClassOrInterface(symbol);
|
||||
if (typeParameters) {
|
||||
type.flags |= 4096;
|
||||
type.typeParameters = typeParameters;
|
||||
type.instantiations = {};
|
||||
type.instantiations[getTypeListId(type.typeParameters)] = type;
|
||||
type.target = type;
|
||||
type.typeArguments = type.typeParameters;
|
||||
}
|
||||
type.declaredProperties = getNamedMembers(symbol.members);
|
||||
type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]);
|
||||
type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]);
|
||||
type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0);
|
||||
type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1);
|
||||
}
|
||||
return links.declaredType;
|
||||
}
|
||||
@@ -10872,11 +10871,8 @@ var ts;
|
||||
}
|
||||
function getDeclaredTypeOfSymbol(symbol) {
|
||||
ts.Debug.assert((symbol.flags & 16777216) === 0);
|
||||
if (symbol.flags & 32) {
|
||||
return getDeclaredTypeOfClass(symbol);
|
||||
}
|
||||
if (symbol.flags & 64) {
|
||||
return getDeclaredTypeOfInterface(symbol);
|
||||
if (symbol.flags & (32 | 64)) {
|
||||
return getDeclaredTypeOfClassOrInterface(symbol);
|
||||
}
|
||||
if (symbol.flags & 524288) {
|
||||
return getDeclaredTypeOfTypeAlias(symbol);
|
||||
@@ -10924,15 +10920,27 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function resolveDeclaredMembers(type) {
|
||||
if (!type.declaredProperties) {
|
||||
var symbol = type.symbol;
|
||||
type.declaredProperties = getNamedMembers(symbol.members);
|
||||
type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]);
|
||||
type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]);
|
||||
type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0);
|
||||
type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
function resolveClassOrInterfaceMembers(type) {
|
||||
var members = type.symbol.members;
|
||||
var callSignatures = type.declaredCallSignatures;
|
||||
var constructSignatures = type.declaredConstructSignatures;
|
||||
var stringIndexType = type.declaredStringIndexType;
|
||||
var numberIndexType = type.declaredNumberIndexType;
|
||||
var baseTypes = getBaseTypes(type);
|
||||
var target = resolveDeclaredMembers(type);
|
||||
var members = target.symbol.members;
|
||||
var callSignatures = target.declaredCallSignatures;
|
||||
var constructSignatures = target.declaredConstructSignatures;
|
||||
var stringIndexType = target.declaredStringIndexType;
|
||||
var numberIndexType = target.declaredNumberIndexType;
|
||||
var baseTypes = getBaseTypes(target);
|
||||
if (baseTypes.length) {
|
||||
members = createSymbolTable(type.declaredProperties);
|
||||
members = createSymbolTable(target.declaredProperties);
|
||||
for (var _i = 0; _i < baseTypes.length; _i++) {
|
||||
var baseType = baseTypes[_i];
|
||||
addInheritedMembers(members, getPropertiesOfObjectType(baseType));
|
||||
@@ -10945,7 +10953,7 @@ var ts;
|
||||
setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType);
|
||||
}
|
||||
function resolveTypeReferenceMembers(type) {
|
||||
var target = type.target;
|
||||
var target = resolveDeclaredMembers(type.target);
|
||||
var mapper = createTypeMapper(target.typeParameters, type.typeArguments);
|
||||
var members = createInstantiatedSymbolTable(target.declaredProperties, mapper);
|
||||
var callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature);
|
||||
@@ -11083,7 +11091,7 @@ var ts;
|
||||
callSignatures = getSignaturesOfSymbol(symbol);
|
||||
}
|
||||
if (symbol.flags & 32) {
|
||||
var classType = getDeclaredTypeOfClass(symbol);
|
||||
var classType = getDeclaredTypeOfClassOrInterface(symbol);
|
||||
constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]);
|
||||
if (!constructSignatures.length) {
|
||||
constructSignatures = getDefaultConstructSignatures(classType);
|
||||
@@ -11184,7 +11192,7 @@ var ts;
|
||||
var type = getApparentType(current);
|
||||
if (type !== unknownType) {
|
||||
var prop = getPropertyOfType(type, name);
|
||||
if (!prop) {
|
||||
if (!prop || getDeclarationFlagsFromSymbol(prop) & (32 | 64)) {
|
||||
return undefined;
|
||||
}
|
||||
if (!props) {
|
||||
@@ -11294,7 +11302,7 @@ var ts;
|
||||
function getSignatureFromDeclaration(declaration) {
|
||||
var links = getNodeLinks(declaration);
|
||||
if (!links.resolvedSignature) {
|
||||
var classType = declaration.kind === 135 ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined;
|
||||
var classType = declaration.kind === 135 ? getDeclaredTypeOfClassOrInterface(declaration.parent.symbol) : undefined;
|
||||
var typeParameters = classType ? classType.typeParameters :
|
||||
declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined;
|
||||
var parameters = [];
|
||||
@@ -11896,7 +11904,7 @@ var ts;
|
||||
return type;
|
||||
}
|
||||
function combineTypeMappers(mapper1, mapper2) {
|
||||
return function (t) { return mapper2(mapper1(t)); };
|
||||
return function (t) { return instantiateType(mapper1(t), mapper2); };
|
||||
}
|
||||
function instantiateTypeParameter(typeParameter, mapper) {
|
||||
var result = createType(512);
|
||||
@@ -15750,21 +15758,21 @@ var ts;
|
||||
case 201:
|
||||
var classSymbol = getSymbolOfNode(node.parent);
|
||||
var classConstructorType = getTypeOfSymbol(classSymbol);
|
||||
var classDecoratorType = instantiateSingleCallFunctionType(globalClassDecoratorType, [classConstructorType]);
|
||||
var classDecoratorType = instantiateSingleCallFunctionType(getGlobalClassDecoratorType(), [classConstructorType]);
|
||||
checkTypeAssignableTo(exprType, classDecoratorType, node);
|
||||
break;
|
||||
case 132:
|
||||
checkTypeAssignableTo(exprType, globalPropertyDecoratorType, node);
|
||||
checkTypeAssignableTo(exprType, getGlobalPropertyDecoratorType(), node);
|
||||
break;
|
||||
case 134:
|
||||
case 136:
|
||||
case 137:
|
||||
var methodType = getTypeOfNode(node.parent);
|
||||
var methodDecoratorType = instantiateSingleCallFunctionType(globalMethodDecoratorType, [methodType]);
|
||||
var methodDecoratorType = instantiateSingleCallFunctionType(getGlobalMethodDecoratorType(), [methodType]);
|
||||
checkTypeAssignableTo(exprType, methodDecoratorType, node);
|
||||
break;
|
||||
case 129:
|
||||
checkTypeAssignableTo(exprType, globalParameterDecoratorType, node);
|
||||
checkTypeAssignableTo(exprType, getGlobalParameterDecoratorType(), node);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -16147,8 +16155,8 @@ var ts;
|
||||
}
|
||||
if (node.condition)
|
||||
checkExpression(node.condition);
|
||||
if (node.iterator)
|
||||
checkExpression(node.iterator);
|
||||
if (node.incrementor)
|
||||
checkExpression(node.incrementor);
|
||||
checkSourceElement(node.statement);
|
||||
}
|
||||
function checkForOfStatement(node) {
|
||||
@@ -16728,7 +16736,7 @@ var ts;
|
||||
return true;
|
||||
}
|
||||
var seen = {};
|
||||
ts.forEach(type.declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; });
|
||||
ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; });
|
||||
var ok = true;
|
||||
for (var _i = 0; _i < baseTypes.length; _i++) {
|
||||
var base = baseTypes[_i];
|
||||
@@ -18223,11 +18231,10 @@ var ts;
|
||||
globalNumberType = getGlobalType("Number");
|
||||
globalBooleanType = getGlobalType("Boolean");
|
||||
globalRegExpType = getGlobalType("RegExp");
|
||||
globalTypedPropertyDescriptorType = getTypeOfGlobalSymbol(getGlobalTypeSymbol("TypedPropertyDescriptor"), 1);
|
||||
globalClassDecoratorType = getGlobalType("ClassDecorator");
|
||||
globalPropertyDecoratorType = getGlobalType("PropertyDecorator");
|
||||
globalMethodDecoratorType = getGlobalType("MethodDecorator");
|
||||
globalParameterDecoratorType = getGlobalType("ParameterDecorator");
|
||||
getGlobalClassDecoratorType = ts.memoize(function () { return getGlobalType("ClassDecorator"); });
|
||||
getGlobalPropertyDecoratorType = ts.memoize(function () { return getGlobalType("PropertyDecorator"); });
|
||||
getGlobalMethodDecoratorType = ts.memoize(function () { return getGlobalType("MethodDecorator"); });
|
||||
getGlobalParameterDecoratorType = ts.memoize(function () { return getGlobalType("ParameterDecorator"); });
|
||||
if (languageVersion >= 2) {
|
||||
globalTemplateStringsArrayType = getGlobalType("TemplateStringsArray");
|
||||
globalESSymbolType = getGlobalType("Symbol");
|
||||
@@ -20499,9 +20506,9 @@ var ts;
|
||||
ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile;
|
||||
function emitFiles(resolver, host, targetSourceFile) {
|
||||
var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};";
|
||||
var decorateHelper = "\nvar __decorate = this.__decorate || (typeof Reflect === \"object\" && Reflect.decorate) || function (decorators, target, key, desc) {\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
|
||||
var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };";
|
||||
var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };";
|
||||
var decorateHelper = "\nif (typeof __decorate !== \"function\") __decorate = function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
|
||||
var metadataHelper = "\nif (typeof __metadata !== \"function\") __metadata = function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};";
|
||||
var paramHelper = "\nif (typeof __param !== \"function\") __param = function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};";
|
||||
var compilerOptions = host.getCompilerOptions();
|
||||
var languageVersion = compilerOptions.target || 0;
|
||||
var sourceMapDataList = compilerOptions.sourceMap ? [] : undefined;
|
||||
@@ -22116,7 +22123,7 @@ var ts;
|
||||
write(";");
|
||||
emitOptional(" ", node.condition);
|
||||
write(";");
|
||||
emitOptional(" ", node.iterator);
|
||||
emitOptional(" ", node.incrementor);
|
||||
write(")");
|
||||
emitEmbeddedStatement(node.statement);
|
||||
}
|
||||
@@ -24154,8 +24161,18 @@ var ts;
|
||||
write("}");
|
||||
}
|
||||
}
|
||||
function emitAMDModule(node, startIndex) {
|
||||
collectExternalModuleInfo(node);
|
||||
function emitAMDDependencies(node, includeNonAmdDependencies) {
|
||||
// An AMD define function has the following shape:
|
||||
// define(id?, dependencies?, factory);
|
||||
//
|
||||
// This has the shape of
|
||||
// define(name, ["module1", "module2"], function (module1Alias) {
|
||||
// The location of the alias in the parameter list in the factory function needs to
|
||||
// match the position of the module name in the dependency list.
|
||||
//
|
||||
// To ensure this is true in cases of modules with no aliases, e.g.:
|
||||
// `import "module"` or `<amd-dependency path= "a.css" />`
|
||||
// we need to add modules without alias names to the end of the dependencies list
|
||||
var aliasedModuleNames = [];
|
||||
var unaliasedModuleNames = [];
|
||||
var importAliasNames = [];
|
||||
@@ -24184,7 +24201,7 @@ var ts;
|
||||
else {
|
||||
importAliasName = getGeneratedNameForNode(importNode);
|
||||
}
|
||||
if (importAliasName) {
|
||||
if (includeNonAmdDependencies && importAliasName) {
|
||||
aliasedModuleNames.push(externalModuleName);
|
||||
importAliasNames.push(importAliasName);
|
||||
}
|
||||
@@ -24192,11 +24209,6 @@ var ts;
|
||||
unaliasedModuleNames.push(externalModuleName);
|
||||
}
|
||||
}
|
||||
writeLine();
|
||||
write("define(");
|
||||
if (node.amdModuleName) {
|
||||
write("\"" + node.amdModuleName + "\", ");
|
||||
}
|
||||
write("[\"require\", \"exports\"");
|
||||
if (aliasedModuleNames.length) {
|
||||
write(", ");
|
||||
@@ -24211,6 +24223,15 @@ var ts;
|
||||
write(", ");
|
||||
write(importAliasNames.join(", "));
|
||||
}
|
||||
}
|
||||
function emitAMDModule(node, startIndex) {
|
||||
collectExternalModuleInfo(node);
|
||||
writeLine();
|
||||
write("define(");
|
||||
if (node.amdModuleName) {
|
||||
write("\"" + node.amdModuleName + "\", ");
|
||||
}
|
||||
emitAMDDependencies(node, true);
|
||||
write(") {");
|
||||
increaseIndent();
|
||||
emitExportStarHelper();
|
||||
@@ -24230,6 +24251,21 @@ var ts;
|
||||
emitTempDeclarations(true);
|
||||
emitExportEquals(false);
|
||||
}
|
||||
function emitUMDModule(node, startIndex) {
|
||||
collectExternalModuleInfo(node);
|
||||
writeLines("(function (deps, factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define(deps, factory);\n }\n})(");
|
||||
emitAMDDependencies(node, false);
|
||||
write(") {");
|
||||
increaseIndent();
|
||||
emitExportStarHelper();
|
||||
emitCaptureThisForNodeIfNecessary(node);
|
||||
emitLinesStartingAt(node.statements, startIndex);
|
||||
emitTempDeclarations(true);
|
||||
emitExportEquals(true);
|
||||
decreaseIndent();
|
||||
writeLine();
|
||||
write("});");
|
||||
}
|
||||
function emitES6Module(node, startIndex) {
|
||||
externalImports = undefined;
|
||||
exportSpecifiers = undefined;
|
||||
@@ -24299,6 +24335,9 @@ var ts;
|
||||
else if (compilerOptions.module === 2) {
|
||||
emitAMDModule(node, startIndex);
|
||||
}
|
||||
else if (compilerOptions.module === 3) {
|
||||
emitUMDModule(node, startIndex);
|
||||
}
|
||||
else {
|
||||
emitCommonJSModule(node, startIndex);
|
||||
}
|
||||
@@ -24784,7 +24823,7 @@ var ts;
|
||||
getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker,
|
||||
getCommonSourceDirectory: function () { return commonSourceDirectory; },
|
||||
emit: emit,
|
||||
getCurrentDirectory: host.getCurrentDirectory,
|
||||
getCurrentDirectory: function () { return host.getCurrentDirectory(); },
|
||||
getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); },
|
||||
getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); },
|
||||
getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); },
|
||||
@@ -24793,14 +24832,14 @@ var ts;
|
||||
return program;
|
||||
function getEmitHost(writeFileCallback) {
|
||||
return {
|
||||
getCanonicalFileName: host.getCanonicalFileName,
|
||||
getCanonicalFileName: function (fileName) { return host.getCanonicalFileName(fileName); },
|
||||
getCommonSourceDirectory: program.getCommonSourceDirectory,
|
||||
getCompilerOptions: program.getCompilerOptions,
|
||||
getCurrentDirectory: host.getCurrentDirectory,
|
||||
getNewLine: host.getNewLine,
|
||||
getCurrentDirectory: function () { return host.getCurrentDirectory(); },
|
||||
getNewLine: function () { return host.getNewLine(); },
|
||||
getSourceFile: program.getSourceFile,
|
||||
getSourceFiles: program.getSourceFiles,
|
||||
writeFile: writeFileCallback || host.writeFile
|
||||
writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); })
|
||||
};
|
||||
}
|
||||
function getDiagnosticsProducingTypeChecker() {
|
||||
@@ -25006,6 +25045,53 @@ var ts;
|
||||
return findSourceFile(fileName, false, file, nameLiteral.pos, nameLiteral.end - nameLiteral.pos);
|
||||
}
|
||||
}
|
||||
function computeCommonSourceDirectory(sourceFiles) {
|
||||
var commonPathComponents;
|
||||
var currentDirectory = host.getCurrentDirectory();
|
||||
ts.forEach(files, function (sourceFile) {
|
||||
if (ts.isDeclarationFile(sourceFile)) {
|
||||
return;
|
||||
}
|
||||
var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, currentDirectory);
|
||||
sourcePathComponents.pop();
|
||||
if (!commonPathComponents) {
|
||||
commonPathComponents = sourcePathComponents;
|
||||
return;
|
||||
}
|
||||
for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) {
|
||||
if (commonPathComponents[i] !== sourcePathComponents[i]) {
|
||||
if (i === 0) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files));
|
||||
return;
|
||||
}
|
||||
commonPathComponents.length = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sourcePathComponents.length < commonPathComponents.length) {
|
||||
commonPathComponents.length = sourcePathComponents.length;
|
||||
}
|
||||
});
|
||||
return ts.getNormalizedPathFromPathComponents(commonPathComponents);
|
||||
}
|
||||
function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) {
|
||||
var allFilesBelongToPath = true;
|
||||
if (sourceFiles) {
|
||||
var currentDirectory = host.getCurrentDirectory();
|
||||
var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory));
|
||||
for (var _i = 0; _i < sourceFiles.length; _i++) {
|
||||
var sourceFile = sourceFiles[_i];
|
||||
if (!ts.isDeclarationFile(sourceFile)) {
|
||||
var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory));
|
||||
if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, sourceFile.fileName, options.rootDir));
|
||||
allFilesBelongToPath = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return allFilesBelongToPath;
|
||||
}
|
||||
function verifyCompilerOptions() {
|
||||
if (options.separateCompilation) {
|
||||
if (options.sourceMap) {
|
||||
@@ -25047,40 +25133,19 @@ var ts;
|
||||
diagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided));
|
||||
}
|
||||
if (options.module && languageVersion >= 2) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_commonjs_or_umd_when_targeting_ES6_or_higher));
|
||||
}
|
||||
if (options.outDir ||
|
||||
options.sourceRoot ||
|
||||
(options.mapRoot &&
|
||||
(!options.out || firstExternalModuleSourceFile !== undefined))) {
|
||||
var commonPathComponents;
|
||||
ts.forEach(files, function (sourceFile) {
|
||||
if (!(sourceFile.flags & 2048)
|
||||
&& !ts.fileExtensionIs(sourceFile.fileName, ".js")) {
|
||||
var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory());
|
||||
sourcePathComponents.pop();
|
||||
if (commonPathComponents) {
|
||||
for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) {
|
||||
if (commonPathComponents[i] !== sourcePathComponents[i]) {
|
||||
if (i === 0) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files));
|
||||
return;
|
||||
}
|
||||
commonPathComponents.length = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sourcePathComponents.length < commonPathComponents.length) {
|
||||
commonPathComponents.length = sourcePathComponents.length;
|
||||
}
|
||||
}
|
||||
else {
|
||||
commonPathComponents = sourcePathComponents;
|
||||
}
|
||||
}
|
||||
});
|
||||
commonSourceDirectory = ts.getNormalizedPathFromPathComponents(commonPathComponents);
|
||||
if (commonSourceDirectory) {
|
||||
if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) {
|
||||
commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, host.getCurrentDirectory());
|
||||
}
|
||||
else {
|
||||
commonSourceDirectory = computeCommonSourceDirectory(files);
|
||||
}
|
||||
if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) {
|
||||
commonSourceDirectory += ts.directorySeparator;
|
||||
}
|
||||
}
|
||||
@@ -25368,8 +25433,8 @@ var ts;
|
||||
if (forStatement.condition) {
|
||||
return textSpan(forStatement.condition);
|
||||
}
|
||||
if (forStatement.iterator) {
|
||||
return textSpan(forStatement.iterator);
|
||||
if (forStatement.incrementor) {
|
||||
return textSpan(forStatement.incrementor);
|
||||
}
|
||||
}
|
||||
function spanInOpenBraceToken(node) {
|
||||
@@ -28003,6 +28068,8 @@ var ts;
|
||||
case 169:
|
||||
case 170:
|
||||
return true;
|
||||
case 152:
|
||||
case 203:
|
||||
case 208:
|
||||
case 198:
|
||||
case 129:
|
||||
@@ -28014,8 +28081,6 @@ var ts;
|
||||
return context.currentTokenSpan.kind === 86 || context.nextTokenSpan.kind === 86;
|
||||
case 188:
|
||||
return context.currentTokenSpan.kind === 125 || context.nextTokenSpan.kind === 125;
|
||||
case 152:
|
||||
return context.currentTokenSpan.kind === 53 || context.nextTokenSpan.kind === 53;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
@@ -34835,6 +34900,9 @@ var ts;
|
||||
if (lineText.charAt(i) == " ") {
|
||||
indentPosition--;
|
||||
}
|
||||
else if (lineText.charAt(i) == "\t") {
|
||||
indentPosition -= editorOptions.IndentSize;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
|
||||
Vendored
+8
-4
@@ -597,7 +597,7 @@ declare module "typescript" {
|
||||
interface ForStatement extends IterationStatement {
|
||||
initializer?: VariableDeclarationList | Expression;
|
||||
condition?: Expression;
|
||||
iterator?: Expression;
|
||||
incrementor?: Expression;
|
||||
}
|
||||
interface ForInStatement extends IterationStatement {
|
||||
initializer: VariableDeclarationList | Expression;
|
||||
@@ -1005,15 +1005,17 @@ declare module "typescript" {
|
||||
}
|
||||
interface InterfaceType extends ObjectType {
|
||||
typeParameters: TypeParameter[];
|
||||
}
|
||||
interface InterfaceTypeWithBaseTypes extends InterfaceType {
|
||||
baseTypes: ObjectType[];
|
||||
}
|
||||
interface InterfaceTypeWithDeclaredMembers extends InterfaceType {
|
||||
declaredProperties: Symbol[];
|
||||
declaredCallSignatures: Signature[];
|
||||
declaredConstructSignatures: Signature[];
|
||||
declaredStringIndexType: Type;
|
||||
declaredNumberIndexType: Type;
|
||||
}
|
||||
interface InterfaceTypeWithBaseTypes extends InterfaceType {
|
||||
baseTypes: ObjectType[];
|
||||
}
|
||||
interface TypeReference extends ObjectType {
|
||||
target: GenericType;
|
||||
typeArguments: Type[];
|
||||
@@ -1095,6 +1097,7 @@ declare module "typescript" {
|
||||
preserveConstEnums?: boolean;
|
||||
project?: string;
|
||||
removeComments?: boolean;
|
||||
rootDir?: string;
|
||||
sourceMap?: boolean;
|
||||
sourceRoot?: string;
|
||||
suppressImplicitAnyIndexErrors?: boolean;
|
||||
@@ -1109,6 +1112,7 @@ declare module "typescript" {
|
||||
None = 0,
|
||||
CommonJS = 1,
|
||||
AMD = 2,
|
||||
UMD = 3,
|
||||
}
|
||||
interface LineAndCharacter {
|
||||
line: number;
|
||||
|
||||
+199
-139
@@ -541,6 +541,7 @@ var ts;
|
||||
ModuleKind[ModuleKind["None"] = 0] = "None";
|
||||
ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS";
|
||||
ModuleKind[ModuleKind["AMD"] = 2] = "AMD";
|
||||
ModuleKind[ModuleKind["UMD"] = 3] = "UMD";
|
||||
})(ts.ModuleKind || (ts.ModuleKind = {}));
|
||||
var ModuleKind = ts.ModuleKind;
|
||||
(function (ScriptTarget) {
|
||||
@@ -960,6 +961,17 @@ var ts;
|
||||
return result;
|
||||
}
|
||||
ts.arrayToMap = arrayToMap;
|
||||
function memoize(callback) {
|
||||
var value;
|
||||
return function () {
|
||||
if (callback) {
|
||||
value = callback();
|
||||
callback = undefined;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
}
|
||||
ts.memoize = memoize;
|
||||
function formatStringFromArgs(text, args, baseIndex) {
|
||||
baseIndex = baseIndex || 0;
|
||||
return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; });
|
||||
@@ -1798,7 +1810,7 @@ var ts;
|
||||
Line_terminator_not_permitted_before_arrow: { code: 1200, category: ts.DiagnosticCategory.Error, key: "Line terminator not permitted before arrow." },
|
||||
Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_or_import_d_from_mod_instead: { code: 1202, category: ts.DiagnosticCategory.Error, key: "Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"' or 'import d from \"mod\"' instead." },
|
||||
Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead: { code: 1203, category: ts.DiagnosticCategory.Error, key: "Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead." },
|
||||
Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile external modules into amd or commonjs when targeting es6 or higher." },
|
||||
Cannot_compile_external_modules_into_amd_commonjs_or_umd_when_targeting_ES6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile external modules into 'amd', 'commonjs' or 'umd' when targeting 'ES6' or higher." },
|
||||
Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: ts.DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." },
|
||||
Decorators_are_not_valid_here: { code: 1206, category: ts.DiagnosticCategory.Error, key: "Decorators are not valid here." },
|
||||
Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: ts.DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." },
|
||||
@@ -2100,7 +2112,7 @@ var ts;
|
||||
Do_not_emit_comments_to_output: { code: 6009, category: ts.DiagnosticCategory.Message, key: "Do not emit comments to output." },
|
||||
Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do not emit outputs." },
|
||||
Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" },
|
||||
Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs' or 'amd'" },
|
||||
Specify_module_code_generation_Colon_commonjs_amd_or_umd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs', 'amd', or 'umd'." },
|
||||
Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print this message." },
|
||||
Print_the_compiler_s_version: { code: 6019, category: ts.DiagnosticCategory.Message, key: "Print the compiler's version." },
|
||||
Compile_the_project_in_the_given_directory: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile the project in the given directory." },
|
||||
@@ -2121,8 +2133,8 @@ var ts;
|
||||
Generates_corresponding_map_file: { code: 6043, category: ts.DiagnosticCategory.Message, key: "Generates corresponding '.map' file." },
|
||||
Compiler_option_0_expects_an_argument: { code: 6044, category: ts.DiagnosticCategory.Error, key: "Compiler option '{0}' expects an argument." },
|
||||
Unterminated_quoted_string_in_response_file_0: { code: 6045, category: ts.DiagnosticCategory.Error, key: "Unterminated quoted string in response file '{0}'." },
|
||||
Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs' or 'amd'." },
|
||||
Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." },
|
||||
Argument_for_module_option_must_be_commonjs_amd_or_umd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs', 'amd', or 'umd'." },
|
||||
Argument_for_target_option_must_be_ES3_ES5_or_ES6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'." },
|
||||
Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: ts.DiagnosticCategory.Error, key: "Locale must be of the form <language> or <language>-<territory>. For example '{0}' or '{1}'." },
|
||||
Unsupported_locale_0: { code: 6049, category: ts.DiagnosticCategory.Error, key: "Unsupported locale '{0}'." },
|
||||
Unable_to_open_file_0: { code: 6050, category: ts.DiagnosticCategory.Error, key: "Unable to open file '{0}'." },
|
||||
@@ -2133,6 +2145,8 @@ var ts;
|
||||
Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: ts.DiagnosticCategory.Message, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." },
|
||||
Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: ts.DiagnosticCategory.Message, key: "Do not emit declarations for code that has an '@internal' annotation." },
|
||||
Preserve_new_lines_when_emitting_code: { code: 6057, category: ts.DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." },
|
||||
Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: ts.DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." },
|
||||
File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { code: 6059, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files." },
|
||||
Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." },
|
||||
Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." },
|
||||
Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." },
|
||||
@@ -2476,7 +2490,7 @@ var ts;
|
||||
function isLineBreak(ch) {
|
||||
// ES5 7.3:
|
||||
// The ECMAScript line terminator characters are listed in Table 3.
|
||||
// Table 3 � Line Terminator Characters
|
||||
// Table 3: Line Terminator Characters
|
||||
// Code Unit Value Name Formal Name
|
||||
// \u000A Line Feed <LF>
|
||||
// \u000D Carriage Return <CR>
|
||||
@@ -3764,10 +3778,7 @@ var ts;
|
||||
parent = node;
|
||||
if (symbolKind & 262128 /* IsContainer */) {
|
||||
container = node;
|
||||
if (lastContainer) {
|
||||
lastContainer.nextContainer = container;
|
||||
}
|
||||
lastContainer = container;
|
||||
addToContainerChain(container);
|
||||
}
|
||||
if (isBlockScopeContainer) {
|
||||
// in incremental scenarios we might reuse nodes that already have locals being allocated
|
||||
@@ -3783,6 +3794,12 @@ var ts;
|
||||
parent = saveParent;
|
||||
blockScopeContainer = savedBlockScopeContainer;
|
||||
}
|
||||
function addToContainerChain(node) {
|
||||
if (lastContainer) {
|
||||
lastContainer.nextContainer = node;
|
||||
}
|
||||
lastContainer = node;
|
||||
}
|
||||
function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) {
|
||||
switch (container.kind) {
|
||||
case 205 /* ModuleDeclaration */:
|
||||
@@ -3916,6 +3933,7 @@ var ts;
|
||||
default:
|
||||
if (!blockScopeContainer.locals) {
|
||||
blockScopeContainer.locals = {};
|
||||
addToContainerChain(blockScopeContainer);
|
||||
}
|
||||
declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes);
|
||||
}
|
||||
@@ -4818,7 +4836,7 @@ var ts;
|
||||
var forStatement = parent_1;
|
||||
return (forStatement.initializer === node && forStatement.initializer.kind !== 199 /* VariableDeclarationList */) ||
|
||||
forStatement.condition === node ||
|
||||
forStatement.iterator === node;
|
||||
forStatement.incrementor === node;
|
||||
case 187 /* ForInStatement */:
|
||||
case 188 /* ForOfStatement */:
|
||||
var forInStatement = parent_1;
|
||||
@@ -6077,7 +6095,7 @@ var ts;
|
||||
case 186 /* ForStatement */:
|
||||
return visitNode(cbNode, node.initializer) ||
|
||||
visitNode(cbNode, node.condition) ||
|
||||
visitNode(cbNode, node.iterator) ||
|
||||
visitNode(cbNode, node.incrementor) ||
|
||||
visitNode(cbNode, node.statement);
|
||||
case 187 /* ForInStatement */:
|
||||
return visitNode(cbNode, node.initializer) ||
|
||||
@@ -8951,7 +8969,7 @@ var ts;
|
||||
}
|
||||
parseExpected(22 /* SemicolonToken */);
|
||||
if (token !== 17 /* CloseParenToken */) {
|
||||
forStatement.iterator = allowInAnd(parseExpression);
|
||||
forStatement.incrementor = allowInAnd(parseExpression);
|
||||
}
|
||||
parseExpected(17 /* CloseParenToken */);
|
||||
forOrForInOrForOfStatement = forStatement;
|
||||
@@ -10712,11 +10730,10 @@ var ts;
|
||||
var globalESSymbolType;
|
||||
var globalIterableType;
|
||||
var anyArrayType;
|
||||
var globalTypedPropertyDescriptorType;
|
||||
var globalClassDecoratorType;
|
||||
var globalParameterDecoratorType;
|
||||
var globalPropertyDecoratorType;
|
||||
var globalMethodDecoratorType;
|
||||
var getGlobalClassDecoratorType;
|
||||
var getGlobalParameterDecoratorType;
|
||||
var getGlobalPropertyDecoratorType;
|
||||
var getGlobalMethodDecoratorType;
|
||||
var tupleTypes = {};
|
||||
var unionTypes = {};
|
||||
var stringLiteralTypes = {};
|
||||
@@ -12927,10 +12944,11 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getDeclaredTypeOfClass(symbol) {
|
||||
function getDeclaredTypeOfClassOrInterface(symbol) {
|
||||
var links = getSymbolLinks(symbol);
|
||||
if (!links.declaredType) {
|
||||
var type = links.declaredType = createObjectType(1024 /* Class */, symbol);
|
||||
var kind = symbol.flags & 32 /* Class */ ? 1024 /* Class */ : 2048 /* Interface */;
|
||||
var type = links.declaredType = createObjectType(kind, symbol);
|
||||
var typeParameters = getTypeParametersOfClassOrInterface(symbol);
|
||||
if (typeParameters) {
|
||||
type.flags |= 4096 /* Reference */;
|
||||
@@ -12940,32 +12958,6 @@ var ts;
|
||||
type.target = type;
|
||||
type.typeArguments = type.typeParameters;
|
||||
}
|
||||
type.declaredProperties = getNamedMembers(symbol.members);
|
||||
type.declaredCallSignatures = emptyArray;
|
||||
type.declaredConstructSignatures = emptyArray;
|
||||
type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */);
|
||||
type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */);
|
||||
}
|
||||
return links.declaredType;
|
||||
}
|
||||
function getDeclaredTypeOfInterface(symbol) {
|
||||
var links = getSymbolLinks(symbol);
|
||||
if (!links.declaredType) {
|
||||
var type = links.declaredType = createObjectType(2048 /* Interface */, symbol);
|
||||
var typeParameters = getTypeParametersOfClassOrInterface(symbol);
|
||||
if (typeParameters) {
|
||||
type.flags |= 4096 /* Reference */;
|
||||
type.typeParameters = typeParameters;
|
||||
type.instantiations = {};
|
||||
type.instantiations[getTypeListId(type.typeParameters)] = type;
|
||||
type.target = type;
|
||||
type.typeArguments = type.typeParameters;
|
||||
}
|
||||
type.declaredProperties = getNamedMembers(symbol.members);
|
||||
type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]);
|
||||
type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]);
|
||||
type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */);
|
||||
type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */);
|
||||
}
|
||||
return links.declaredType;
|
||||
}
|
||||
@@ -13016,11 +13008,8 @@ var ts;
|
||||
}
|
||||
function getDeclaredTypeOfSymbol(symbol) {
|
||||
ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0);
|
||||
if (symbol.flags & 32 /* Class */) {
|
||||
return getDeclaredTypeOfClass(symbol);
|
||||
}
|
||||
if (symbol.flags & 64 /* Interface */) {
|
||||
return getDeclaredTypeOfInterface(symbol);
|
||||
if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) {
|
||||
return getDeclaredTypeOfClassOrInterface(symbol);
|
||||
}
|
||||
if (symbol.flags & 524288 /* TypeAlias */) {
|
||||
return getDeclaredTypeOfTypeAlias(symbol);
|
||||
@@ -13068,15 +13057,27 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function resolveDeclaredMembers(type) {
|
||||
if (!type.declaredProperties) {
|
||||
var symbol = type.symbol;
|
||||
type.declaredProperties = getNamedMembers(symbol.members);
|
||||
type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]);
|
||||
type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]);
|
||||
type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */);
|
||||
type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
function resolveClassOrInterfaceMembers(type) {
|
||||
var members = type.symbol.members;
|
||||
var callSignatures = type.declaredCallSignatures;
|
||||
var constructSignatures = type.declaredConstructSignatures;
|
||||
var stringIndexType = type.declaredStringIndexType;
|
||||
var numberIndexType = type.declaredNumberIndexType;
|
||||
var baseTypes = getBaseTypes(type);
|
||||
var target = resolveDeclaredMembers(type);
|
||||
var members = target.symbol.members;
|
||||
var callSignatures = target.declaredCallSignatures;
|
||||
var constructSignatures = target.declaredConstructSignatures;
|
||||
var stringIndexType = target.declaredStringIndexType;
|
||||
var numberIndexType = target.declaredNumberIndexType;
|
||||
var baseTypes = getBaseTypes(target);
|
||||
if (baseTypes.length) {
|
||||
members = createSymbolTable(type.declaredProperties);
|
||||
members = createSymbolTable(target.declaredProperties);
|
||||
for (var _i = 0; _i < baseTypes.length; _i++) {
|
||||
var baseType = baseTypes[_i];
|
||||
addInheritedMembers(members, getPropertiesOfObjectType(baseType));
|
||||
@@ -13089,7 +13090,7 @@ var ts;
|
||||
setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType);
|
||||
}
|
||||
function resolveTypeReferenceMembers(type) {
|
||||
var target = type.target;
|
||||
var target = resolveDeclaredMembers(type.target);
|
||||
var mapper = createTypeMapper(target.typeParameters, type.typeArguments);
|
||||
var members = createInstantiatedSymbolTable(target.declaredProperties, mapper);
|
||||
var callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature);
|
||||
@@ -13234,7 +13235,7 @@ var ts;
|
||||
callSignatures = getSignaturesOfSymbol(symbol);
|
||||
}
|
||||
if (symbol.flags & 32 /* Class */) {
|
||||
var classType = getDeclaredTypeOfClass(symbol);
|
||||
var classType = getDeclaredTypeOfClassOrInterface(symbol);
|
||||
constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]);
|
||||
if (!constructSignatures.length) {
|
||||
constructSignatures = getDefaultConstructSignatures(classType);
|
||||
@@ -13341,7 +13342,7 @@ var ts;
|
||||
var type = getApparentType(current);
|
||||
if (type !== unknownType) {
|
||||
var prop = getPropertyOfType(type, name);
|
||||
if (!prop) {
|
||||
if (!prop || getDeclarationFlagsFromSymbol(prop) & (32 /* Private */ | 64 /* Protected */)) {
|
||||
return undefined;
|
||||
}
|
||||
if (!props) {
|
||||
@@ -13460,7 +13461,7 @@ var ts;
|
||||
function getSignatureFromDeclaration(declaration) {
|
||||
var links = getNodeLinks(declaration);
|
||||
if (!links.resolvedSignature) {
|
||||
var classType = declaration.kind === 135 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined;
|
||||
var classType = declaration.kind === 135 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(declaration.parent.symbol) : undefined;
|
||||
var typeParameters = classType ? classType.typeParameters :
|
||||
declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined;
|
||||
var parameters = [];
|
||||
@@ -14105,7 +14106,7 @@ var ts;
|
||||
return type;
|
||||
}
|
||||
function combineTypeMappers(mapper1, mapper2) {
|
||||
return function (t) { return mapper2(mapper1(t)); };
|
||||
return function (t) { return instantiateType(mapper1(t), mapper2); };
|
||||
}
|
||||
function instantiateTypeParameter(typeParameter, mapper) {
|
||||
var result = createType(512 /* TypeParameter */);
|
||||
@@ -18689,21 +18690,21 @@ var ts;
|
||||
case 201 /* ClassDeclaration */:
|
||||
var classSymbol = getSymbolOfNode(node.parent);
|
||||
var classConstructorType = getTypeOfSymbol(classSymbol);
|
||||
var classDecoratorType = instantiateSingleCallFunctionType(globalClassDecoratorType, [classConstructorType]);
|
||||
var classDecoratorType = instantiateSingleCallFunctionType(getGlobalClassDecoratorType(), [classConstructorType]);
|
||||
checkTypeAssignableTo(exprType, classDecoratorType, node);
|
||||
break;
|
||||
case 132 /* PropertyDeclaration */:
|
||||
checkTypeAssignableTo(exprType, globalPropertyDecoratorType, node);
|
||||
checkTypeAssignableTo(exprType, getGlobalPropertyDecoratorType(), node);
|
||||
break;
|
||||
case 134 /* MethodDeclaration */:
|
||||
case 136 /* GetAccessor */:
|
||||
case 137 /* SetAccessor */:
|
||||
var methodType = getTypeOfNode(node.parent);
|
||||
var methodDecoratorType = instantiateSingleCallFunctionType(globalMethodDecoratorType, [methodType]);
|
||||
var methodDecoratorType = instantiateSingleCallFunctionType(getGlobalMethodDecoratorType(), [methodType]);
|
||||
checkTypeAssignableTo(exprType, methodDecoratorType, node);
|
||||
break;
|
||||
case 129 /* Parameter */:
|
||||
checkTypeAssignableTo(exprType, globalParameterDecoratorType, node);
|
||||
checkTypeAssignableTo(exprType, getGlobalParameterDecoratorType(), node);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -19176,8 +19177,8 @@ var ts;
|
||||
}
|
||||
if (node.condition)
|
||||
checkExpression(node.condition);
|
||||
if (node.iterator)
|
||||
checkExpression(node.iterator);
|
||||
if (node.incrementor)
|
||||
checkExpression(node.incrementor);
|
||||
checkSourceElement(node.statement);
|
||||
}
|
||||
function checkForOfStatement(node) {
|
||||
@@ -19858,7 +19859,7 @@ var ts;
|
||||
return true;
|
||||
}
|
||||
var seen = {};
|
||||
ts.forEach(type.declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; });
|
||||
ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; });
|
||||
var ok = true;
|
||||
for (var _i = 0; _i < baseTypes.length; _i++) {
|
||||
var base = baseTypes[_i];
|
||||
@@ -21518,11 +21519,10 @@ var ts;
|
||||
globalNumberType = getGlobalType("Number");
|
||||
globalBooleanType = getGlobalType("Boolean");
|
||||
globalRegExpType = getGlobalType("RegExp");
|
||||
globalTypedPropertyDescriptorType = getTypeOfGlobalSymbol(getGlobalTypeSymbol("TypedPropertyDescriptor"), 1);
|
||||
globalClassDecoratorType = getGlobalType("ClassDecorator");
|
||||
globalPropertyDecoratorType = getGlobalType("PropertyDecorator");
|
||||
globalMethodDecoratorType = getGlobalType("MethodDecorator");
|
||||
globalParameterDecoratorType = getGlobalType("ParameterDecorator");
|
||||
getGlobalClassDecoratorType = ts.memoize(function () { return getGlobalType("ClassDecorator"); });
|
||||
getGlobalPropertyDecoratorType = ts.memoize(function () { return getGlobalType("PropertyDecorator"); });
|
||||
getGlobalMethodDecoratorType = ts.memoize(function () { return getGlobalType("MethodDecorator"); });
|
||||
getGlobalParameterDecoratorType = ts.memoize(function () { return getGlobalType("ParameterDecorator"); });
|
||||
// If we're in ES6 mode, load the TemplateStringsArray.
|
||||
// Otherwise, default to 'unknown' for the purposes of type checking in LS scenarios.
|
||||
if (languageVersion >= 2 /* ES6 */) {
|
||||
@@ -24025,11 +24025,11 @@ var ts;
|
||||
// emit output for the __extends helper function
|
||||
var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};";
|
||||
// emit output for the __decorate helper function
|
||||
var decorateHelper = "\nvar __decorate = this.__decorate || (typeof Reflect === \"object\" && Reflect.decorate) || function (decorators, target, key, desc) {\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
|
||||
var decorateHelper = "\nif (typeof __decorate !== \"function\") __decorate = function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
|
||||
// emit output for the __metadata helper function
|
||||
var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };";
|
||||
var metadataHelper = "\nif (typeof __metadata !== \"function\") __metadata = function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};";
|
||||
// emit output for the __param helper function
|
||||
var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };";
|
||||
var paramHelper = "\nif (typeof __param !== \"function\") __param = function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};";
|
||||
var compilerOptions = host.getCompilerOptions();
|
||||
var languageVersion = compilerOptions.target || 0 /* ES3 */;
|
||||
var sourceMapDataList = compilerOptions.sourceMap ? [] : undefined;
|
||||
@@ -25861,7 +25861,7 @@ var ts;
|
||||
write(";");
|
||||
emitOptional(" ", node.condition);
|
||||
write(";");
|
||||
emitOptional(" ", node.iterator);
|
||||
emitOptional(" ", node.incrementor);
|
||||
write(")");
|
||||
emitEmbeddedStatement(node.statement);
|
||||
}
|
||||
@@ -28162,25 +28162,24 @@ var ts;
|
||||
write("}");
|
||||
}
|
||||
}
|
||||
function emitAMDModule(node, startIndex) {
|
||||
collectExternalModuleInfo(node);
|
||||
function emitAMDDependencies(node, includeNonAmdDependencies) {
|
||||
// An AMD define function has the following shape:
|
||||
// define(id?, dependencies?, factory);
|
||||
//
|
||||
// This has the shape of
|
||||
// define(name, ["module1", "module2"], function (module1Alias) {
|
||||
// The location of the alias in the parameter list in the factory function needs to
|
||||
// The location of the alias in the parameter list in the factory function needs to
|
||||
// match the position of the module name in the dependency list.
|
||||
//
|
||||
// To ensure this is true in cases of modules with no aliases, e.g.:
|
||||
// `import "module"` or `<amd-dependency path= "a.css" />`
|
||||
// To ensure this is true in cases of modules with no aliases, e.g.:
|
||||
// `import "module"` or `<amd-dependency path= "a.css" />`
|
||||
// we need to add modules without alias names to the end of the dependencies list
|
||||
var aliasedModuleNames = []; // names of modules with corresponding parameter in the
|
||||
var aliasedModuleNames = []; // names of modules with corresponding parameter in the
|
||||
// factory function.
|
||||
var unaliasedModuleNames = []; // names of modules with no corresponding parameters in
|
||||
// factory function.
|
||||
var importAliasNames = []; // names of the parameters in the factory function; these
|
||||
// paramters need to match the indexes of the corresponding
|
||||
var importAliasNames = []; // names of the parameters in the factory function; these
|
||||
// parameters need to match the indexes of the corresponding
|
||||
// module names in aliasedModuleNames.
|
||||
// Fill in amd-dependency tags
|
||||
for (var _a = 0, _b = node.amdDependencies; _a < _b.length; _a++) {
|
||||
@@ -28201,7 +28200,7 @@ var ts;
|
||||
if (moduleName.kind === 8 /* StringLiteral */) {
|
||||
externalModuleName = getLiteralText(moduleName);
|
||||
}
|
||||
// Find the name of the module alais, if there is one
|
||||
// Find the name of the module alias, if there is one
|
||||
var importAliasName = void 0;
|
||||
var namespaceDeclaration = getNamespaceDeclarationNode(importNode);
|
||||
if (namespaceDeclaration && !isDefaultImport(importNode)) {
|
||||
@@ -28210,7 +28209,7 @@ var ts;
|
||||
else {
|
||||
importAliasName = getGeneratedNameForNode(importNode);
|
||||
}
|
||||
if (importAliasName) {
|
||||
if (includeNonAmdDependencies && importAliasName) {
|
||||
aliasedModuleNames.push(externalModuleName);
|
||||
importAliasNames.push(importAliasName);
|
||||
}
|
||||
@@ -28218,11 +28217,6 @@ var ts;
|
||||
unaliasedModuleNames.push(externalModuleName);
|
||||
}
|
||||
}
|
||||
writeLine();
|
||||
write("define(");
|
||||
if (node.amdModuleName) {
|
||||
write("\"" + node.amdModuleName + "\", ");
|
||||
}
|
||||
write("[\"require\", \"exports\"");
|
||||
if (aliasedModuleNames.length) {
|
||||
write(", ");
|
||||
@@ -28237,6 +28231,15 @@ var ts;
|
||||
write(", ");
|
||||
write(importAliasNames.join(", "));
|
||||
}
|
||||
}
|
||||
function emitAMDModule(node, startIndex) {
|
||||
collectExternalModuleInfo(node);
|
||||
writeLine();
|
||||
write("define(");
|
||||
if (node.amdModuleName) {
|
||||
write("\"" + node.amdModuleName + "\", ");
|
||||
}
|
||||
emitAMDDependencies(node, true);
|
||||
write(") {");
|
||||
increaseIndent();
|
||||
emitExportStarHelper();
|
||||
@@ -28256,6 +28259,22 @@ var ts;
|
||||
emitTempDeclarations(true);
|
||||
emitExportEquals(false);
|
||||
}
|
||||
function emitUMDModule(node, startIndex) {
|
||||
collectExternalModuleInfo(node);
|
||||
// Module is detected first to support Browserify users that load into a browser with an AMD loader
|
||||
writeLines("(function (deps, factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define(deps, factory);\n }\n})(");
|
||||
emitAMDDependencies(node, false);
|
||||
write(") {");
|
||||
increaseIndent();
|
||||
emitExportStarHelper();
|
||||
emitCaptureThisForNodeIfNecessary(node);
|
||||
emitLinesStartingAt(node.statements, startIndex);
|
||||
emitTempDeclarations(true);
|
||||
emitExportEquals(true);
|
||||
decreaseIndent();
|
||||
writeLine();
|
||||
write("});");
|
||||
}
|
||||
function emitES6Module(node, startIndex) {
|
||||
externalImports = undefined;
|
||||
exportSpecifiers = undefined;
|
||||
@@ -28332,6 +28351,9 @@ var ts;
|
||||
else if (compilerOptions.module === 2 /* AMD */) {
|
||||
emitAMDModule(node, startIndex);
|
||||
}
|
||||
else if (compilerOptions.module === 3 /* UMD */) {
|
||||
emitUMDModule(node, startIndex);
|
||||
}
|
||||
else {
|
||||
emitCommonJSModule(node, startIndex);
|
||||
}
|
||||
@@ -28855,7 +28877,7 @@ var ts;
|
||||
getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker,
|
||||
getCommonSourceDirectory: function () { return commonSourceDirectory; },
|
||||
emit: emit,
|
||||
getCurrentDirectory: host.getCurrentDirectory,
|
||||
getCurrentDirectory: function () { return host.getCurrentDirectory(); },
|
||||
getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); },
|
||||
getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); },
|
||||
getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); },
|
||||
@@ -28864,14 +28886,14 @@ var ts;
|
||||
return program;
|
||||
function getEmitHost(writeFileCallback) {
|
||||
return {
|
||||
getCanonicalFileName: host.getCanonicalFileName,
|
||||
getCanonicalFileName: function (fileName) { return host.getCanonicalFileName(fileName); },
|
||||
getCommonSourceDirectory: program.getCommonSourceDirectory,
|
||||
getCompilerOptions: program.getCompilerOptions,
|
||||
getCurrentDirectory: host.getCurrentDirectory,
|
||||
getNewLine: host.getNewLine,
|
||||
getCurrentDirectory: function () { return host.getCurrentDirectory(); },
|
||||
getNewLine: function () { return host.getNewLine(); },
|
||||
getSourceFile: program.getSourceFile,
|
||||
getSourceFiles: program.getSourceFiles,
|
||||
writeFile: writeFileCallback || host.writeFile
|
||||
writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); })
|
||||
};
|
||||
}
|
||||
function getDiagnosticsProducingTypeChecker() {
|
||||
@@ -29095,6 +29117,57 @@ var ts;
|
||||
return findSourceFile(fileName, false, file, nameLiteral.pos, nameLiteral.end - nameLiteral.pos);
|
||||
}
|
||||
}
|
||||
function computeCommonSourceDirectory(sourceFiles) {
|
||||
var commonPathComponents;
|
||||
var currentDirectory = host.getCurrentDirectory();
|
||||
ts.forEach(files, function (sourceFile) {
|
||||
// Each file contributes into common source file path
|
||||
if (ts.isDeclarationFile(sourceFile)) {
|
||||
return;
|
||||
}
|
||||
var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, currentDirectory);
|
||||
sourcePathComponents.pop(); // The base file name is not part of the common directory path
|
||||
if (!commonPathComponents) {
|
||||
// first file
|
||||
commonPathComponents = sourcePathComponents;
|
||||
return;
|
||||
}
|
||||
for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) {
|
||||
if (commonPathComponents[i] !== sourcePathComponents[i]) {
|
||||
if (i === 0) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files));
|
||||
return;
|
||||
}
|
||||
// New common path found that is 0 -> i-1
|
||||
commonPathComponents.length = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// If the sourcePathComponents was shorter than the commonPathComponents, truncate to the sourcePathComponents
|
||||
if (sourcePathComponents.length < commonPathComponents.length) {
|
||||
commonPathComponents.length = sourcePathComponents.length;
|
||||
}
|
||||
});
|
||||
return ts.getNormalizedPathFromPathComponents(commonPathComponents);
|
||||
}
|
||||
function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) {
|
||||
var allFilesBelongToPath = true;
|
||||
if (sourceFiles) {
|
||||
var currentDirectory = host.getCurrentDirectory();
|
||||
var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory));
|
||||
for (var _i = 0; _i < sourceFiles.length; _i++) {
|
||||
var sourceFile = sourceFiles[_i];
|
||||
if (!ts.isDeclarationFile(sourceFile)) {
|
||||
var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory));
|
||||
if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, sourceFile.fileName, options.rootDir));
|
||||
allFilesBelongToPath = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return allFilesBelongToPath;
|
||||
}
|
||||
function verifyCompilerOptions() {
|
||||
if (options.separateCompilation) {
|
||||
if (options.sourceMap) {
|
||||
@@ -29139,7 +29212,7 @@ var ts;
|
||||
}
|
||||
// Cannot specify module gen target when in es6 or above
|
||||
if (options.module && languageVersion >= 2 /* ES6 */) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_commonjs_or_umd_when_targeting_ES6_or_higher));
|
||||
}
|
||||
// there has to be common source directory if user specified --outdir || --sourceRoot
|
||||
// if user specified --mapRoot, there needs to be common source directory if there would be multiple files being emitted
|
||||
@@ -29147,38 +29220,15 @@ var ts;
|
||||
options.sourceRoot ||
|
||||
(options.mapRoot &&
|
||||
(!options.out || firstExternalModuleSourceFile !== undefined))) {
|
||||
var commonPathComponents;
|
||||
ts.forEach(files, function (sourceFile) {
|
||||
// Each file contributes into common source file path
|
||||
if (!(sourceFile.flags & 2048 /* DeclarationFile */)
|
||||
&& !ts.fileExtensionIs(sourceFile.fileName, ".js")) {
|
||||
var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory());
|
||||
sourcePathComponents.pop(); // FileName is not part of directory
|
||||
if (commonPathComponents) {
|
||||
for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) {
|
||||
if (commonPathComponents[i] !== sourcePathComponents[i]) {
|
||||
if (i === 0) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files));
|
||||
return;
|
||||
}
|
||||
// New common path found that is 0 -> i-1
|
||||
commonPathComponents.length = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// If the fileComponent path completely matched and less than already found update the length
|
||||
if (sourcePathComponents.length < commonPathComponents.length) {
|
||||
commonPathComponents.length = sourcePathComponents.length;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// first file
|
||||
commonPathComponents = sourcePathComponents;
|
||||
}
|
||||
}
|
||||
});
|
||||
commonSourceDirectory = ts.getNormalizedPathFromPathComponents(commonPathComponents);
|
||||
if (commonSourceDirectory) {
|
||||
if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) {
|
||||
// If a rootDir is specified and is valid use it as the commonSourceDirectory
|
||||
commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, host.getCurrentDirectory());
|
||||
}
|
||||
else {
|
||||
// Compute the commonSourceDirectory from the input files
|
||||
commonSourceDirectory = computeCommonSourceDirectory(files);
|
||||
}
|
||||
if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) {
|
||||
// Make sure directory path ends with directory separator so this string can directly
|
||||
// used to replace with "" to get the relative path of the source file and the relative path doesn't
|
||||
// start with / making it rooted path
|
||||
@@ -29249,11 +29299,12 @@ var ts;
|
||||
shortName: "m",
|
||||
type: {
|
||||
"commonjs": 1 /* CommonJS */,
|
||||
"amd": 2 /* AMD */
|
||||
"amd": 2 /* AMD */,
|
||||
"umd": 3 /* UMD */
|
||||
},
|
||||
description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_or_amd,
|
||||
description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_or_umd,
|
||||
paramType: ts.Diagnostics.KIND,
|
||||
error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd
|
||||
error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_amd_or_umd
|
||||
},
|
||||
{
|
||||
name: "noEmit",
|
||||
@@ -29309,6 +29360,13 @@ var ts;
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Do_not_emit_comments_to_output
|
||||
},
|
||||
{
|
||||
name: "rootDir",
|
||||
type: "string",
|
||||
isFilePath: true,
|
||||
description: ts.Diagnostics.Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir,
|
||||
paramType: ts.Diagnostics.LOCATION
|
||||
},
|
||||
{
|
||||
name: "separateCompilation",
|
||||
type: "boolean"
|
||||
@@ -29342,7 +29400,7 @@ var ts;
|
||||
type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */, "es6": 2 /* ES6 */ },
|
||||
description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental,
|
||||
paramType: ts.Diagnostics.VERSION,
|
||||
error: ts.Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6
|
||||
error: ts.Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6
|
||||
},
|
||||
{
|
||||
name: "version",
|
||||
@@ -32767,6 +32825,10 @@ var ts;
|
||||
case 169 /* BinaryExpression */:
|
||||
case 170 /* ConditionalExpression */:
|
||||
return true;
|
||||
// equals in binding elements: function foo([[x, y] = [1, 2]])
|
||||
case 152 /* BindingElement */:
|
||||
// equals in type X = ...
|
||||
case 203 /* TypeAliasDeclaration */:
|
||||
// equal in import a = module('a');
|
||||
case 208 /* ImportEqualsDeclaration */:
|
||||
// equal in let a = 0;
|
||||
@@ -32783,8 +32845,6 @@ var ts;
|
||||
// Technically, "of" is not a binary operator, but format it the same way as "in"
|
||||
case 188 /* ForOfStatement */:
|
||||
return context.currentTokenSpan.kind === 125 /* OfKeyword */ || context.nextTokenSpan.kind === 125 /* OfKeyword */;
|
||||
case 152 /* BindingElement */:
|
||||
return context.currentTokenSpan.kind === 53 /* EqualsToken */ || context.nextTokenSpan.kind === 53 /* EqualsToken */;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
@@ -40444,8 +40504,8 @@ var ts;
|
||||
if (forStatement.condition) {
|
||||
return textSpan(forStatement.condition);
|
||||
}
|
||||
if (forStatement.iterator) {
|
||||
return textSpan(forStatement.iterator);
|
||||
if (forStatement.incrementor) {
|
||||
return textSpan(forStatement.incrementor);
|
||||
}
|
||||
}
|
||||
// Tokens:
|
||||
|
||||
Vendored
+8
-4
@@ -597,7 +597,7 @@ declare module ts {
|
||||
interface ForStatement extends IterationStatement {
|
||||
initializer?: VariableDeclarationList | Expression;
|
||||
condition?: Expression;
|
||||
iterator?: Expression;
|
||||
incrementor?: Expression;
|
||||
}
|
||||
interface ForInStatement extends IterationStatement {
|
||||
initializer: VariableDeclarationList | Expression;
|
||||
@@ -1005,15 +1005,17 @@ declare module ts {
|
||||
}
|
||||
interface InterfaceType extends ObjectType {
|
||||
typeParameters: TypeParameter[];
|
||||
}
|
||||
interface InterfaceTypeWithBaseTypes extends InterfaceType {
|
||||
baseTypes: ObjectType[];
|
||||
}
|
||||
interface InterfaceTypeWithDeclaredMembers extends InterfaceType {
|
||||
declaredProperties: Symbol[];
|
||||
declaredCallSignatures: Signature[];
|
||||
declaredConstructSignatures: Signature[];
|
||||
declaredStringIndexType: Type;
|
||||
declaredNumberIndexType: Type;
|
||||
}
|
||||
interface InterfaceTypeWithBaseTypes extends InterfaceType {
|
||||
baseTypes: ObjectType[];
|
||||
}
|
||||
interface TypeReference extends ObjectType {
|
||||
target: GenericType;
|
||||
typeArguments: Type[];
|
||||
@@ -1095,6 +1097,7 @@ declare module ts {
|
||||
preserveConstEnums?: boolean;
|
||||
project?: string;
|
||||
removeComments?: boolean;
|
||||
rootDir?: string;
|
||||
sourceMap?: boolean;
|
||||
sourceRoot?: string;
|
||||
suppressImplicitAnyIndexErrors?: boolean;
|
||||
@@ -1109,6 +1112,7 @@ declare module ts {
|
||||
None = 0,
|
||||
CommonJS = 1,
|
||||
AMD = 2,
|
||||
UMD = 3,
|
||||
}
|
||||
interface LineAndCharacter {
|
||||
line: number;
|
||||
|
||||
+199
-139
@@ -541,6 +541,7 @@ var ts;
|
||||
ModuleKind[ModuleKind["None"] = 0] = "None";
|
||||
ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS";
|
||||
ModuleKind[ModuleKind["AMD"] = 2] = "AMD";
|
||||
ModuleKind[ModuleKind["UMD"] = 3] = "UMD";
|
||||
})(ts.ModuleKind || (ts.ModuleKind = {}));
|
||||
var ModuleKind = ts.ModuleKind;
|
||||
(function (ScriptTarget) {
|
||||
@@ -960,6 +961,17 @@ var ts;
|
||||
return result;
|
||||
}
|
||||
ts.arrayToMap = arrayToMap;
|
||||
function memoize(callback) {
|
||||
var value;
|
||||
return function () {
|
||||
if (callback) {
|
||||
value = callback();
|
||||
callback = undefined;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
}
|
||||
ts.memoize = memoize;
|
||||
function formatStringFromArgs(text, args, baseIndex) {
|
||||
baseIndex = baseIndex || 0;
|
||||
return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; });
|
||||
@@ -1798,7 +1810,7 @@ var ts;
|
||||
Line_terminator_not_permitted_before_arrow: { code: 1200, category: ts.DiagnosticCategory.Error, key: "Line terminator not permitted before arrow." },
|
||||
Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_or_import_d_from_mod_instead: { code: 1202, category: ts.DiagnosticCategory.Error, key: "Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"' or 'import d from \"mod\"' instead." },
|
||||
Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead: { code: 1203, category: ts.DiagnosticCategory.Error, key: "Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead." },
|
||||
Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile external modules into amd or commonjs when targeting es6 or higher." },
|
||||
Cannot_compile_external_modules_into_amd_commonjs_or_umd_when_targeting_ES6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile external modules into 'amd', 'commonjs' or 'umd' when targeting 'ES6' or higher." },
|
||||
Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: ts.DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." },
|
||||
Decorators_are_not_valid_here: { code: 1206, category: ts.DiagnosticCategory.Error, key: "Decorators are not valid here." },
|
||||
Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: ts.DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." },
|
||||
@@ -2100,7 +2112,7 @@ var ts;
|
||||
Do_not_emit_comments_to_output: { code: 6009, category: ts.DiagnosticCategory.Message, key: "Do not emit comments to output." },
|
||||
Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do not emit outputs." },
|
||||
Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" },
|
||||
Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs' or 'amd'" },
|
||||
Specify_module_code_generation_Colon_commonjs_amd_or_umd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs', 'amd', or 'umd'." },
|
||||
Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print this message." },
|
||||
Print_the_compiler_s_version: { code: 6019, category: ts.DiagnosticCategory.Message, key: "Print the compiler's version." },
|
||||
Compile_the_project_in_the_given_directory: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile the project in the given directory." },
|
||||
@@ -2121,8 +2133,8 @@ var ts;
|
||||
Generates_corresponding_map_file: { code: 6043, category: ts.DiagnosticCategory.Message, key: "Generates corresponding '.map' file." },
|
||||
Compiler_option_0_expects_an_argument: { code: 6044, category: ts.DiagnosticCategory.Error, key: "Compiler option '{0}' expects an argument." },
|
||||
Unterminated_quoted_string_in_response_file_0: { code: 6045, category: ts.DiagnosticCategory.Error, key: "Unterminated quoted string in response file '{0}'." },
|
||||
Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs' or 'amd'." },
|
||||
Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." },
|
||||
Argument_for_module_option_must_be_commonjs_amd_or_umd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs', 'amd', or 'umd'." },
|
||||
Argument_for_target_option_must_be_ES3_ES5_or_ES6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'." },
|
||||
Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: ts.DiagnosticCategory.Error, key: "Locale must be of the form <language> or <language>-<territory>. For example '{0}' or '{1}'." },
|
||||
Unsupported_locale_0: { code: 6049, category: ts.DiagnosticCategory.Error, key: "Unsupported locale '{0}'." },
|
||||
Unable_to_open_file_0: { code: 6050, category: ts.DiagnosticCategory.Error, key: "Unable to open file '{0}'." },
|
||||
@@ -2133,6 +2145,8 @@ var ts;
|
||||
Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: ts.DiagnosticCategory.Message, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." },
|
||||
Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: ts.DiagnosticCategory.Message, key: "Do not emit declarations for code that has an '@internal' annotation." },
|
||||
Preserve_new_lines_when_emitting_code: { code: 6057, category: ts.DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." },
|
||||
Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: ts.DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." },
|
||||
File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { code: 6059, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files." },
|
||||
Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." },
|
||||
Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." },
|
||||
Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." },
|
||||
@@ -2476,7 +2490,7 @@ var ts;
|
||||
function isLineBreak(ch) {
|
||||
// ES5 7.3:
|
||||
// The ECMAScript line terminator characters are listed in Table 3.
|
||||
// Table 3 � Line Terminator Characters
|
||||
// Table 3: Line Terminator Characters
|
||||
// Code Unit Value Name Formal Name
|
||||
// \u000A Line Feed <LF>
|
||||
// \u000D Carriage Return <CR>
|
||||
@@ -3764,10 +3778,7 @@ var ts;
|
||||
parent = node;
|
||||
if (symbolKind & 262128 /* IsContainer */) {
|
||||
container = node;
|
||||
if (lastContainer) {
|
||||
lastContainer.nextContainer = container;
|
||||
}
|
||||
lastContainer = container;
|
||||
addToContainerChain(container);
|
||||
}
|
||||
if (isBlockScopeContainer) {
|
||||
// in incremental scenarios we might reuse nodes that already have locals being allocated
|
||||
@@ -3783,6 +3794,12 @@ var ts;
|
||||
parent = saveParent;
|
||||
blockScopeContainer = savedBlockScopeContainer;
|
||||
}
|
||||
function addToContainerChain(node) {
|
||||
if (lastContainer) {
|
||||
lastContainer.nextContainer = node;
|
||||
}
|
||||
lastContainer = node;
|
||||
}
|
||||
function bindDeclaration(node, symbolKind, symbolExcludes, isBlockScopeContainer) {
|
||||
switch (container.kind) {
|
||||
case 205 /* ModuleDeclaration */:
|
||||
@@ -3916,6 +3933,7 @@ var ts;
|
||||
default:
|
||||
if (!blockScopeContainer.locals) {
|
||||
blockScopeContainer.locals = {};
|
||||
addToContainerChain(blockScopeContainer);
|
||||
}
|
||||
declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes);
|
||||
}
|
||||
@@ -4818,7 +4836,7 @@ var ts;
|
||||
var forStatement = parent_1;
|
||||
return (forStatement.initializer === node && forStatement.initializer.kind !== 199 /* VariableDeclarationList */) ||
|
||||
forStatement.condition === node ||
|
||||
forStatement.iterator === node;
|
||||
forStatement.incrementor === node;
|
||||
case 187 /* ForInStatement */:
|
||||
case 188 /* ForOfStatement */:
|
||||
var forInStatement = parent_1;
|
||||
@@ -6077,7 +6095,7 @@ var ts;
|
||||
case 186 /* ForStatement */:
|
||||
return visitNode(cbNode, node.initializer) ||
|
||||
visitNode(cbNode, node.condition) ||
|
||||
visitNode(cbNode, node.iterator) ||
|
||||
visitNode(cbNode, node.incrementor) ||
|
||||
visitNode(cbNode, node.statement);
|
||||
case 187 /* ForInStatement */:
|
||||
return visitNode(cbNode, node.initializer) ||
|
||||
@@ -8951,7 +8969,7 @@ var ts;
|
||||
}
|
||||
parseExpected(22 /* SemicolonToken */);
|
||||
if (token !== 17 /* CloseParenToken */) {
|
||||
forStatement.iterator = allowInAnd(parseExpression);
|
||||
forStatement.incrementor = allowInAnd(parseExpression);
|
||||
}
|
||||
parseExpected(17 /* CloseParenToken */);
|
||||
forOrForInOrForOfStatement = forStatement;
|
||||
@@ -10712,11 +10730,10 @@ var ts;
|
||||
var globalESSymbolType;
|
||||
var globalIterableType;
|
||||
var anyArrayType;
|
||||
var globalTypedPropertyDescriptorType;
|
||||
var globalClassDecoratorType;
|
||||
var globalParameterDecoratorType;
|
||||
var globalPropertyDecoratorType;
|
||||
var globalMethodDecoratorType;
|
||||
var getGlobalClassDecoratorType;
|
||||
var getGlobalParameterDecoratorType;
|
||||
var getGlobalPropertyDecoratorType;
|
||||
var getGlobalMethodDecoratorType;
|
||||
var tupleTypes = {};
|
||||
var unionTypes = {};
|
||||
var stringLiteralTypes = {};
|
||||
@@ -12927,10 +12944,11 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getDeclaredTypeOfClass(symbol) {
|
||||
function getDeclaredTypeOfClassOrInterface(symbol) {
|
||||
var links = getSymbolLinks(symbol);
|
||||
if (!links.declaredType) {
|
||||
var type = links.declaredType = createObjectType(1024 /* Class */, symbol);
|
||||
var kind = symbol.flags & 32 /* Class */ ? 1024 /* Class */ : 2048 /* Interface */;
|
||||
var type = links.declaredType = createObjectType(kind, symbol);
|
||||
var typeParameters = getTypeParametersOfClassOrInterface(symbol);
|
||||
if (typeParameters) {
|
||||
type.flags |= 4096 /* Reference */;
|
||||
@@ -12940,32 +12958,6 @@ var ts;
|
||||
type.target = type;
|
||||
type.typeArguments = type.typeParameters;
|
||||
}
|
||||
type.declaredProperties = getNamedMembers(symbol.members);
|
||||
type.declaredCallSignatures = emptyArray;
|
||||
type.declaredConstructSignatures = emptyArray;
|
||||
type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */);
|
||||
type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */);
|
||||
}
|
||||
return links.declaredType;
|
||||
}
|
||||
function getDeclaredTypeOfInterface(symbol) {
|
||||
var links = getSymbolLinks(symbol);
|
||||
if (!links.declaredType) {
|
||||
var type = links.declaredType = createObjectType(2048 /* Interface */, symbol);
|
||||
var typeParameters = getTypeParametersOfClassOrInterface(symbol);
|
||||
if (typeParameters) {
|
||||
type.flags |= 4096 /* Reference */;
|
||||
type.typeParameters = typeParameters;
|
||||
type.instantiations = {};
|
||||
type.instantiations[getTypeListId(type.typeParameters)] = type;
|
||||
type.target = type;
|
||||
type.typeArguments = type.typeParameters;
|
||||
}
|
||||
type.declaredProperties = getNamedMembers(symbol.members);
|
||||
type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]);
|
||||
type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]);
|
||||
type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */);
|
||||
type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */);
|
||||
}
|
||||
return links.declaredType;
|
||||
}
|
||||
@@ -13016,11 +13008,8 @@ var ts;
|
||||
}
|
||||
function getDeclaredTypeOfSymbol(symbol) {
|
||||
ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0);
|
||||
if (symbol.flags & 32 /* Class */) {
|
||||
return getDeclaredTypeOfClass(symbol);
|
||||
}
|
||||
if (symbol.flags & 64 /* Interface */) {
|
||||
return getDeclaredTypeOfInterface(symbol);
|
||||
if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) {
|
||||
return getDeclaredTypeOfClassOrInterface(symbol);
|
||||
}
|
||||
if (symbol.flags & 524288 /* TypeAlias */) {
|
||||
return getDeclaredTypeOfTypeAlias(symbol);
|
||||
@@ -13068,15 +13057,27 @@ var ts;
|
||||
}
|
||||
}
|
||||
}
|
||||
function resolveDeclaredMembers(type) {
|
||||
if (!type.declaredProperties) {
|
||||
var symbol = type.symbol;
|
||||
type.declaredProperties = getNamedMembers(symbol.members);
|
||||
type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]);
|
||||
type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]);
|
||||
type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */);
|
||||
type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
function resolveClassOrInterfaceMembers(type) {
|
||||
var members = type.symbol.members;
|
||||
var callSignatures = type.declaredCallSignatures;
|
||||
var constructSignatures = type.declaredConstructSignatures;
|
||||
var stringIndexType = type.declaredStringIndexType;
|
||||
var numberIndexType = type.declaredNumberIndexType;
|
||||
var baseTypes = getBaseTypes(type);
|
||||
var target = resolveDeclaredMembers(type);
|
||||
var members = target.symbol.members;
|
||||
var callSignatures = target.declaredCallSignatures;
|
||||
var constructSignatures = target.declaredConstructSignatures;
|
||||
var stringIndexType = target.declaredStringIndexType;
|
||||
var numberIndexType = target.declaredNumberIndexType;
|
||||
var baseTypes = getBaseTypes(target);
|
||||
if (baseTypes.length) {
|
||||
members = createSymbolTable(type.declaredProperties);
|
||||
members = createSymbolTable(target.declaredProperties);
|
||||
for (var _i = 0; _i < baseTypes.length; _i++) {
|
||||
var baseType = baseTypes[_i];
|
||||
addInheritedMembers(members, getPropertiesOfObjectType(baseType));
|
||||
@@ -13089,7 +13090,7 @@ var ts;
|
||||
setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType);
|
||||
}
|
||||
function resolveTypeReferenceMembers(type) {
|
||||
var target = type.target;
|
||||
var target = resolveDeclaredMembers(type.target);
|
||||
var mapper = createTypeMapper(target.typeParameters, type.typeArguments);
|
||||
var members = createInstantiatedSymbolTable(target.declaredProperties, mapper);
|
||||
var callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature);
|
||||
@@ -13234,7 +13235,7 @@ var ts;
|
||||
callSignatures = getSignaturesOfSymbol(symbol);
|
||||
}
|
||||
if (symbol.flags & 32 /* Class */) {
|
||||
var classType = getDeclaredTypeOfClass(symbol);
|
||||
var classType = getDeclaredTypeOfClassOrInterface(symbol);
|
||||
constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]);
|
||||
if (!constructSignatures.length) {
|
||||
constructSignatures = getDefaultConstructSignatures(classType);
|
||||
@@ -13341,7 +13342,7 @@ var ts;
|
||||
var type = getApparentType(current);
|
||||
if (type !== unknownType) {
|
||||
var prop = getPropertyOfType(type, name);
|
||||
if (!prop) {
|
||||
if (!prop || getDeclarationFlagsFromSymbol(prop) & (32 /* Private */ | 64 /* Protected */)) {
|
||||
return undefined;
|
||||
}
|
||||
if (!props) {
|
||||
@@ -13460,7 +13461,7 @@ var ts;
|
||||
function getSignatureFromDeclaration(declaration) {
|
||||
var links = getNodeLinks(declaration);
|
||||
if (!links.resolvedSignature) {
|
||||
var classType = declaration.kind === 135 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined;
|
||||
var classType = declaration.kind === 135 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(declaration.parent.symbol) : undefined;
|
||||
var typeParameters = classType ? classType.typeParameters :
|
||||
declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined;
|
||||
var parameters = [];
|
||||
@@ -14105,7 +14106,7 @@ var ts;
|
||||
return type;
|
||||
}
|
||||
function combineTypeMappers(mapper1, mapper2) {
|
||||
return function (t) { return mapper2(mapper1(t)); };
|
||||
return function (t) { return instantiateType(mapper1(t), mapper2); };
|
||||
}
|
||||
function instantiateTypeParameter(typeParameter, mapper) {
|
||||
var result = createType(512 /* TypeParameter */);
|
||||
@@ -18689,21 +18690,21 @@ var ts;
|
||||
case 201 /* ClassDeclaration */:
|
||||
var classSymbol = getSymbolOfNode(node.parent);
|
||||
var classConstructorType = getTypeOfSymbol(classSymbol);
|
||||
var classDecoratorType = instantiateSingleCallFunctionType(globalClassDecoratorType, [classConstructorType]);
|
||||
var classDecoratorType = instantiateSingleCallFunctionType(getGlobalClassDecoratorType(), [classConstructorType]);
|
||||
checkTypeAssignableTo(exprType, classDecoratorType, node);
|
||||
break;
|
||||
case 132 /* PropertyDeclaration */:
|
||||
checkTypeAssignableTo(exprType, globalPropertyDecoratorType, node);
|
||||
checkTypeAssignableTo(exprType, getGlobalPropertyDecoratorType(), node);
|
||||
break;
|
||||
case 134 /* MethodDeclaration */:
|
||||
case 136 /* GetAccessor */:
|
||||
case 137 /* SetAccessor */:
|
||||
var methodType = getTypeOfNode(node.parent);
|
||||
var methodDecoratorType = instantiateSingleCallFunctionType(globalMethodDecoratorType, [methodType]);
|
||||
var methodDecoratorType = instantiateSingleCallFunctionType(getGlobalMethodDecoratorType(), [methodType]);
|
||||
checkTypeAssignableTo(exprType, methodDecoratorType, node);
|
||||
break;
|
||||
case 129 /* Parameter */:
|
||||
checkTypeAssignableTo(exprType, globalParameterDecoratorType, node);
|
||||
checkTypeAssignableTo(exprType, getGlobalParameterDecoratorType(), node);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -19176,8 +19177,8 @@ var ts;
|
||||
}
|
||||
if (node.condition)
|
||||
checkExpression(node.condition);
|
||||
if (node.iterator)
|
||||
checkExpression(node.iterator);
|
||||
if (node.incrementor)
|
||||
checkExpression(node.incrementor);
|
||||
checkSourceElement(node.statement);
|
||||
}
|
||||
function checkForOfStatement(node) {
|
||||
@@ -19858,7 +19859,7 @@ var ts;
|
||||
return true;
|
||||
}
|
||||
var seen = {};
|
||||
ts.forEach(type.declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; });
|
||||
ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; });
|
||||
var ok = true;
|
||||
for (var _i = 0; _i < baseTypes.length; _i++) {
|
||||
var base = baseTypes[_i];
|
||||
@@ -21518,11 +21519,10 @@ var ts;
|
||||
globalNumberType = getGlobalType("Number");
|
||||
globalBooleanType = getGlobalType("Boolean");
|
||||
globalRegExpType = getGlobalType("RegExp");
|
||||
globalTypedPropertyDescriptorType = getTypeOfGlobalSymbol(getGlobalTypeSymbol("TypedPropertyDescriptor"), 1);
|
||||
globalClassDecoratorType = getGlobalType("ClassDecorator");
|
||||
globalPropertyDecoratorType = getGlobalType("PropertyDecorator");
|
||||
globalMethodDecoratorType = getGlobalType("MethodDecorator");
|
||||
globalParameterDecoratorType = getGlobalType("ParameterDecorator");
|
||||
getGlobalClassDecoratorType = ts.memoize(function () { return getGlobalType("ClassDecorator"); });
|
||||
getGlobalPropertyDecoratorType = ts.memoize(function () { return getGlobalType("PropertyDecorator"); });
|
||||
getGlobalMethodDecoratorType = ts.memoize(function () { return getGlobalType("MethodDecorator"); });
|
||||
getGlobalParameterDecoratorType = ts.memoize(function () { return getGlobalType("ParameterDecorator"); });
|
||||
// If we're in ES6 mode, load the TemplateStringsArray.
|
||||
// Otherwise, default to 'unknown' for the purposes of type checking in LS scenarios.
|
||||
if (languageVersion >= 2 /* ES6 */) {
|
||||
@@ -24025,11 +24025,11 @@ var ts;
|
||||
// emit output for the __extends helper function
|
||||
var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};";
|
||||
// emit output for the __decorate helper function
|
||||
var decorateHelper = "\nvar __decorate = this.__decorate || (typeof Reflect === \"object\" && Reflect.decorate) || function (decorators, target, key, desc) {\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
|
||||
var decorateHelper = "\nif (typeof __decorate !== \"function\") __decorate = function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
|
||||
// emit output for the __metadata helper function
|
||||
var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };";
|
||||
var metadataHelper = "\nif (typeof __metadata !== \"function\") __metadata = function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};";
|
||||
// emit output for the __param helper function
|
||||
var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };";
|
||||
var paramHelper = "\nif (typeof __param !== \"function\") __param = function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};";
|
||||
var compilerOptions = host.getCompilerOptions();
|
||||
var languageVersion = compilerOptions.target || 0 /* ES3 */;
|
||||
var sourceMapDataList = compilerOptions.sourceMap ? [] : undefined;
|
||||
@@ -25861,7 +25861,7 @@ var ts;
|
||||
write(";");
|
||||
emitOptional(" ", node.condition);
|
||||
write(";");
|
||||
emitOptional(" ", node.iterator);
|
||||
emitOptional(" ", node.incrementor);
|
||||
write(")");
|
||||
emitEmbeddedStatement(node.statement);
|
||||
}
|
||||
@@ -28162,25 +28162,24 @@ var ts;
|
||||
write("}");
|
||||
}
|
||||
}
|
||||
function emitAMDModule(node, startIndex) {
|
||||
collectExternalModuleInfo(node);
|
||||
function emitAMDDependencies(node, includeNonAmdDependencies) {
|
||||
// An AMD define function has the following shape:
|
||||
// define(id?, dependencies?, factory);
|
||||
//
|
||||
// This has the shape of
|
||||
// define(name, ["module1", "module2"], function (module1Alias) {
|
||||
// The location of the alias in the parameter list in the factory function needs to
|
||||
// The location of the alias in the parameter list in the factory function needs to
|
||||
// match the position of the module name in the dependency list.
|
||||
//
|
||||
// To ensure this is true in cases of modules with no aliases, e.g.:
|
||||
// `import "module"` or `<amd-dependency path= "a.css" />`
|
||||
// To ensure this is true in cases of modules with no aliases, e.g.:
|
||||
// `import "module"` or `<amd-dependency path= "a.css" />`
|
||||
// we need to add modules without alias names to the end of the dependencies list
|
||||
var aliasedModuleNames = []; // names of modules with corresponding parameter in the
|
||||
var aliasedModuleNames = []; // names of modules with corresponding parameter in the
|
||||
// factory function.
|
||||
var unaliasedModuleNames = []; // names of modules with no corresponding parameters in
|
||||
// factory function.
|
||||
var importAliasNames = []; // names of the parameters in the factory function; these
|
||||
// paramters need to match the indexes of the corresponding
|
||||
var importAliasNames = []; // names of the parameters in the factory function; these
|
||||
// parameters need to match the indexes of the corresponding
|
||||
// module names in aliasedModuleNames.
|
||||
// Fill in amd-dependency tags
|
||||
for (var _a = 0, _b = node.amdDependencies; _a < _b.length; _a++) {
|
||||
@@ -28201,7 +28200,7 @@ var ts;
|
||||
if (moduleName.kind === 8 /* StringLiteral */) {
|
||||
externalModuleName = getLiteralText(moduleName);
|
||||
}
|
||||
// Find the name of the module alais, if there is one
|
||||
// Find the name of the module alias, if there is one
|
||||
var importAliasName = void 0;
|
||||
var namespaceDeclaration = getNamespaceDeclarationNode(importNode);
|
||||
if (namespaceDeclaration && !isDefaultImport(importNode)) {
|
||||
@@ -28210,7 +28209,7 @@ var ts;
|
||||
else {
|
||||
importAliasName = getGeneratedNameForNode(importNode);
|
||||
}
|
||||
if (importAliasName) {
|
||||
if (includeNonAmdDependencies && importAliasName) {
|
||||
aliasedModuleNames.push(externalModuleName);
|
||||
importAliasNames.push(importAliasName);
|
||||
}
|
||||
@@ -28218,11 +28217,6 @@ var ts;
|
||||
unaliasedModuleNames.push(externalModuleName);
|
||||
}
|
||||
}
|
||||
writeLine();
|
||||
write("define(");
|
||||
if (node.amdModuleName) {
|
||||
write("\"" + node.amdModuleName + "\", ");
|
||||
}
|
||||
write("[\"require\", \"exports\"");
|
||||
if (aliasedModuleNames.length) {
|
||||
write(", ");
|
||||
@@ -28237,6 +28231,15 @@ var ts;
|
||||
write(", ");
|
||||
write(importAliasNames.join(", "));
|
||||
}
|
||||
}
|
||||
function emitAMDModule(node, startIndex) {
|
||||
collectExternalModuleInfo(node);
|
||||
writeLine();
|
||||
write("define(");
|
||||
if (node.amdModuleName) {
|
||||
write("\"" + node.amdModuleName + "\", ");
|
||||
}
|
||||
emitAMDDependencies(node, true);
|
||||
write(") {");
|
||||
increaseIndent();
|
||||
emitExportStarHelper();
|
||||
@@ -28256,6 +28259,22 @@ var ts;
|
||||
emitTempDeclarations(true);
|
||||
emitExportEquals(false);
|
||||
}
|
||||
function emitUMDModule(node, startIndex) {
|
||||
collectExternalModuleInfo(node);
|
||||
// Module is detected first to support Browserify users that load into a browser with an AMD loader
|
||||
writeLines("(function (deps, factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define(deps, factory);\n }\n})(");
|
||||
emitAMDDependencies(node, false);
|
||||
write(") {");
|
||||
increaseIndent();
|
||||
emitExportStarHelper();
|
||||
emitCaptureThisForNodeIfNecessary(node);
|
||||
emitLinesStartingAt(node.statements, startIndex);
|
||||
emitTempDeclarations(true);
|
||||
emitExportEquals(true);
|
||||
decreaseIndent();
|
||||
writeLine();
|
||||
write("});");
|
||||
}
|
||||
function emitES6Module(node, startIndex) {
|
||||
externalImports = undefined;
|
||||
exportSpecifiers = undefined;
|
||||
@@ -28332,6 +28351,9 @@ var ts;
|
||||
else if (compilerOptions.module === 2 /* AMD */) {
|
||||
emitAMDModule(node, startIndex);
|
||||
}
|
||||
else if (compilerOptions.module === 3 /* UMD */) {
|
||||
emitUMDModule(node, startIndex);
|
||||
}
|
||||
else {
|
||||
emitCommonJSModule(node, startIndex);
|
||||
}
|
||||
@@ -28855,7 +28877,7 @@ var ts;
|
||||
getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker,
|
||||
getCommonSourceDirectory: function () { return commonSourceDirectory; },
|
||||
emit: emit,
|
||||
getCurrentDirectory: host.getCurrentDirectory,
|
||||
getCurrentDirectory: function () { return host.getCurrentDirectory(); },
|
||||
getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); },
|
||||
getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); },
|
||||
getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); },
|
||||
@@ -28864,14 +28886,14 @@ var ts;
|
||||
return program;
|
||||
function getEmitHost(writeFileCallback) {
|
||||
return {
|
||||
getCanonicalFileName: host.getCanonicalFileName,
|
||||
getCanonicalFileName: function (fileName) { return host.getCanonicalFileName(fileName); },
|
||||
getCommonSourceDirectory: program.getCommonSourceDirectory,
|
||||
getCompilerOptions: program.getCompilerOptions,
|
||||
getCurrentDirectory: host.getCurrentDirectory,
|
||||
getNewLine: host.getNewLine,
|
||||
getCurrentDirectory: function () { return host.getCurrentDirectory(); },
|
||||
getNewLine: function () { return host.getNewLine(); },
|
||||
getSourceFile: program.getSourceFile,
|
||||
getSourceFiles: program.getSourceFiles,
|
||||
writeFile: writeFileCallback || host.writeFile
|
||||
writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); })
|
||||
};
|
||||
}
|
||||
function getDiagnosticsProducingTypeChecker() {
|
||||
@@ -29095,6 +29117,57 @@ var ts;
|
||||
return findSourceFile(fileName, false, file, nameLiteral.pos, nameLiteral.end - nameLiteral.pos);
|
||||
}
|
||||
}
|
||||
function computeCommonSourceDirectory(sourceFiles) {
|
||||
var commonPathComponents;
|
||||
var currentDirectory = host.getCurrentDirectory();
|
||||
ts.forEach(files, function (sourceFile) {
|
||||
// Each file contributes into common source file path
|
||||
if (ts.isDeclarationFile(sourceFile)) {
|
||||
return;
|
||||
}
|
||||
var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, currentDirectory);
|
||||
sourcePathComponents.pop(); // The base file name is not part of the common directory path
|
||||
if (!commonPathComponents) {
|
||||
// first file
|
||||
commonPathComponents = sourcePathComponents;
|
||||
return;
|
||||
}
|
||||
for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) {
|
||||
if (commonPathComponents[i] !== sourcePathComponents[i]) {
|
||||
if (i === 0) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files));
|
||||
return;
|
||||
}
|
||||
// New common path found that is 0 -> i-1
|
||||
commonPathComponents.length = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// If the sourcePathComponents was shorter than the commonPathComponents, truncate to the sourcePathComponents
|
||||
if (sourcePathComponents.length < commonPathComponents.length) {
|
||||
commonPathComponents.length = sourcePathComponents.length;
|
||||
}
|
||||
});
|
||||
return ts.getNormalizedPathFromPathComponents(commonPathComponents);
|
||||
}
|
||||
function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) {
|
||||
var allFilesBelongToPath = true;
|
||||
if (sourceFiles) {
|
||||
var currentDirectory = host.getCurrentDirectory();
|
||||
var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory));
|
||||
for (var _i = 0; _i < sourceFiles.length; _i++) {
|
||||
var sourceFile = sourceFiles[_i];
|
||||
if (!ts.isDeclarationFile(sourceFile)) {
|
||||
var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory));
|
||||
if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, sourceFile.fileName, options.rootDir));
|
||||
allFilesBelongToPath = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return allFilesBelongToPath;
|
||||
}
|
||||
function verifyCompilerOptions() {
|
||||
if (options.separateCompilation) {
|
||||
if (options.sourceMap) {
|
||||
@@ -29139,7 +29212,7 @@ var ts;
|
||||
}
|
||||
// Cannot specify module gen target when in es6 or above
|
||||
if (options.module && languageVersion >= 2 /* ES6 */) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_external_modules_into_amd_commonjs_or_umd_when_targeting_ES6_or_higher));
|
||||
}
|
||||
// there has to be common source directory if user specified --outdir || --sourceRoot
|
||||
// if user specified --mapRoot, there needs to be common source directory if there would be multiple files being emitted
|
||||
@@ -29147,38 +29220,15 @@ var ts;
|
||||
options.sourceRoot ||
|
||||
(options.mapRoot &&
|
||||
(!options.out || firstExternalModuleSourceFile !== undefined))) {
|
||||
var commonPathComponents;
|
||||
ts.forEach(files, function (sourceFile) {
|
||||
// Each file contributes into common source file path
|
||||
if (!(sourceFile.flags & 2048 /* DeclarationFile */)
|
||||
&& !ts.fileExtensionIs(sourceFile.fileName, ".js")) {
|
||||
var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory());
|
||||
sourcePathComponents.pop(); // FileName is not part of directory
|
||||
if (commonPathComponents) {
|
||||
for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) {
|
||||
if (commonPathComponents[i] !== sourcePathComponents[i]) {
|
||||
if (i === 0) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files));
|
||||
return;
|
||||
}
|
||||
// New common path found that is 0 -> i-1
|
||||
commonPathComponents.length = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// If the fileComponent path completely matched and less than already found update the length
|
||||
if (sourcePathComponents.length < commonPathComponents.length) {
|
||||
commonPathComponents.length = sourcePathComponents.length;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// first file
|
||||
commonPathComponents = sourcePathComponents;
|
||||
}
|
||||
}
|
||||
});
|
||||
commonSourceDirectory = ts.getNormalizedPathFromPathComponents(commonPathComponents);
|
||||
if (commonSourceDirectory) {
|
||||
if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) {
|
||||
// If a rootDir is specified and is valid use it as the commonSourceDirectory
|
||||
commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, host.getCurrentDirectory());
|
||||
}
|
||||
else {
|
||||
// Compute the commonSourceDirectory from the input files
|
||||
commonSourceDirectory = computeCommonSourceDirectory(files);
|
||||
}
|
||||
if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) {
|
||||
// Make sure directory path ends with directory separator so this string can directly
|
||||
// used to replace with "" to get the relative path of the source file and the relative path doesn't
|
||||
// start with / making it rooted path
|
||||
@@ -29249,11 +29299,12 @@ var ts;
|
||||
shortName: "m",
|
||||
type: {
|
||||
"commonjs": 1 /* CommonJS */,
|
||||
"amd": 2 /* AMD */
|
||||
"amd": 2 /* AMD */,
|
||||
"umd": 3 /* UMD */
|
||||
},
|
||||
description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_or_amd,
|
||||
description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_or_umd,
|
||||
paramType: ts.Diagnostics.KIND,
|
||||
error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd
|
||||
error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_amd_or_umd
|
||||
},
|
||||
{
|
||||
name: "noEmit",
|
||||
@@ -29309,6 +29360,13 @@ var ts;
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Do_not_emit_comments_to_output
|
||||
},
|
||||
{
|
||||
name: "rootDir",
|
||||
type: "string",
|
||||
isFilePath: true,
|
||||
description: ts.Diagnostics.Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir,
|
||||
paramType: ts.Diagnostics.LOCATION
|
||||
},
|
||||
{
|
||||
name: "separateCompilation",
|
||||
type: "boolean"
|
||||
@@ -29342,7 +29400,7 @@ var ts;
|
||||
type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */, "es6": 2 /* ES6 */ },
|
||||
description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental,
|
||||
paramType: ts.Diagnostics.VERSION,
|
||||
error: ts.Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6
|
||||
error: ts.Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6
|
||||
},
|
||||
{
|
||||
name: "version",
|
||||
@@ -32767,6 +32825,10 @@ var ts;
|
||||
case 169 /* BinaryExpression */:
|
||||
case 170 /* ConditionalExpression */:
|
||||
return true;
|
||||
// equals in binding elements: function foo([[x, y] = [1, 2]])
|
||||
case 152 /* BindingElement */:
|
||||
// equals in type X = ...
|
||||
case 203 /* TypeAliasDeclaration */:
|
||||
// equal in import a = module('a');
|
||||
case 208 /* ImportEqualsDeclaration */:
|
||||
// equal in let a = 0;
|
||||
@@ -32783,8 +32845,6 @@ var ts;
|
||||
// Technically, "of" is not a binary operator, but format it the same way as "in"
|
||||
case 188 /* ForOfStatement */:
|
||||
return context.currentTokenSpan.kind === 125 /* OfKeyword */ || context.nextTokenSpan.kind === 125 /* OfKeyword */;
|
||||
case 152 /* BindingElement */:
|
||||
return context.currentTokenSpan.kind === 53 /* EqualsToken */ || context.nextTokenSpan.kind === 53 /* EqualsToken */;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
@@ -40444,8 +40504,8 @@ var ts;
|
||||
if (forStatement.condition) {
|
||||
return textSpan(forStatement.condition);
|
||||
}
|
||||
if (forStatement.iterator) {
|
||||
return textSpan(forStatement.iterator);
|
||||
if (forStatement.incrementor) {
|
||||
return textSpan(forStatement.incrementor);
|
||||
}
|
||||
}
|
||||
// Tokens:
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.1" id="logo-typescript" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 283.09 69.57">
|
||||
<g fill="#007ACC">
|
||||
<path d="M34.98 7.56H20.43v45.07h-5.91V7.56H0V2.21h34.98V7.56z"/>
|
||||
<path d="M57.94 16.63L41.38 58.39c-2.95 7.45-7.1 11.18-12.45 11.18 -1.5 0-2.75-0.15-3.76-0.46v-5.17c1.24 0.42 2.38 0.63 3.41 0.63 2.91 0 5.09-1.73 6.54-5.2l2.88-6.82L23.94 16.63h6.4l9.74 27.7c0.12 0.35 0.36 1.27 0.74 2.74h0.21c0.12-0.56 0.35-1.45 0.7-2.67l10.23-27.77H57.94z"/>
|
||||
<path d="M67.37 47.43h-0.14v21.76h-5.77V16.63h5.77v6.33h0.14c2.84-4.78 6.98-7.17 12.45-7.17 4.64 0 8.26 1.61 10.86 4.83 2.6 3.22 3.9 7.54 3.9 12.96 0 6.02-1.46 10.85-4.39 14.47 -2.93 3.62-6.94 5.43-12.02 5.43C73.5 53.47 69.9 51.46 67.37 47.43zM67.23 32.91v5.03c0 2.98 0.97 5.5 2.9 7.58s4.39 3.11 7.37 3.11c3.49 0 6.23-1.34 8.21-4.01 1.98-2.67 2.97-6.39 2.97-11.14 0-4.01-0.93-7.15-2.78-9.42 -1.85-2.27-4.36-3.41-7.52-3.41 -3.35 0-6.05 1.17-8.09 3.5C68.25 26.47 67.23 29.39 67.23 32.91z"/>
|
||||
<path d="M129.56 36.07h-25.42c0.09 4.01 1.17 7.1 3.23 9.28 2.06 2.18 4.9 3.27 8.51 3.27 4.05 0 7.78-1.34 11.18-4.01v5.41c-3.16 2.3-7.35 3.45-12.55 3.45 -5.09 0-9.08-1.63-11.99-4.9 -2.91-3.27-4.36-7.87-4.36-13.8 0-5.6 1.59-10.17 4.76-13.69 3.18-3.53 7.12-5.29 11.83-5.29s8.35 1.52 10.93 4.57c2.58 3.05 3.87 7.28 3.87 12.69V36.07zM123.65 31.18c-0.02-3.33-0.83-5.92-2.41-7.77 -1.58-1.85-3.78-2.78-6.59-2.78 -2.72 0-5.03 0.97-6.93 2.92 -1.9 1.95-3.07 4.49-3.52 7.63H123.65z"/>
|
||||
<path d="M134.6 50.59v-6.96c0.73 0.7 1.6 1.34 2.62 1.9 1.02 0.56 2.09 1.04 3.22 1.42s2.26 0.69 3.39 0.9c1.14 0.21 2.19 0.32 3.15 0.32 3.32 0 5.81-0.67 7.45-2.02 1.64-1.35 2.46-3.29 2.46-5.82 0-1.36-0.27-2.54-0.82-3.55 -0.55-1.01-1.3-1.93-2.27-2.76s-2.11-1.63-3.43-2.39c-1.32-0.76-2.74-1.56-4.26-2.41 -1.61-0.89-3.11-1.79-4.5-2.71 -1.39-0.91-2.61-1.92-3.63-3.02 -1.03-1.1-1.84-2.35-2.43-3.74 -0.59-1.39-0.88-3.03-0.88-4.9 0-2.3 0.46-4.29 1.38-5.99 0.92-1.7 2.13-3.1 3.64-4.2 1.5-1.1 3.21-1.92 5.13-2.46 1.92-0.54 3.88-0.81 5.87-0.81 4.55 0 7.86 0.6 9.94 1.79v6.64c-2.72-2.06-6.22-3.09-10.49-3.09 -1.18 0-2.36 0.14-3.54 0.4 -1.18 0.27-2.23 0.71-3.15 1.32 -0.92 0.61-1.67 1.39-2.25 2.36 -0.58 0.96-0.87 2.13-0.87 3.52 0 1.29 0.22 2.4 0.66 3.34 0.44 0.94 1.09 1.79 1.95 2.57 0.86 0.77 1.9 1.52 3.14 2.25 1.23 0.73 2.65 1.52 4.26 2.39 1.65 0.89 3.22 1.83 4.7 2.81s2.78 2.07 3.89 3.27c1.11 1.2 2 2.52 2.65 3.97 0.65 1.45 0.98 3.12 0.98 4.99 0 2.48-0.45 4.59-1.33 6.31 -0.89 1.72-2.09 3.12-3.6 4.2 -1.51 1.08-3.25 1.86-5.23 2.34 -1.97 0.48-4.05 0.72-6.24 0.72 -0.73 0-1.63-0.06-2.7-0.19s-2.17-0.32-3.28-0.56c-1.12-0.25-2.17-0.55-3.17-0.91C136 51.44 135.21 51.03 134.6 50.59z"/>
|
||||
<path d="M193.25 50.98c-2.77 1.66-6.05 2.5-9.84 2.5 -5.13 0-9.28-1.67-12.43-5.01s-4.73-7.67-4.73-12.99c0-5.93 1.7-10.69 5.1-14.29 3.4-3.6 7.93-5.4 13.61-5.4 3.16 0 5.95 0.59 8.37 1.76v5.91c-2.67-1.88-5.53-2.81-8.58-2.81 -3.68 0-6.7 1.32-9.05 3.96s-3.53 6.1-3.53 10.39c0 4.22 1.11 7.55 3.32 9.98s5.19 3.66 8.91 3.66c3.14 0 6.09-1.04 8.86-3.13V50.98z"/>
|
||||
<path d="M215.56 22.46c-1.01-0.77-2.46-1.16-4.36-1.16 -2.46 0-4.52 1.16-6.17 3.48s-2.48 5.48-2.48 9.49v18.35h-5.77v-36h5.77v7.42h0.14c0.82-2.53 2.07-4.51 3.76-5.92 1.69-1.42 3.57-2.13 5.66-2.13 1.5 0 2.65 0.16 3.45 0.49V22.46z"/>
|
||||
<path d="M222.18 7.49c-1.03 0-1.91-0.35-2.64-1.05s-1.09-1.59-1.09-2.67c0-1.08 0.36-1.97 1.09-2.69 0.73-0.71 1.61-1.07 2.64-1.07 1.05 0 1.95 0.36 2.69 1.07 0.74 0.72 1.11 1.61 1.11 2.69 0 1.03-0.37 1.91-1.11 2.64C224.13 7.12 223.23 7.49 222.18 7.49zM224.99 52.63h-5.77v-36h5.77V52.63z"/>
|
||||
<path d="M234.29 47.43h-0.14v21.76h-5.77V16.63h5.77v6.33h0.14c2.84-4.78 6.98-7.17 12.45-7.17 4.64 0 8.26 1.61 10.86 4.83 2.6 3.22 3.9 7.54 3.9 12.96 0 6.02-1.46 10.85-4.39 14.47s-6.94 5.43-12.02 5.43C240.42 53.47 236.82 51.46 234.29 47.43zM234.15 32.91v5.03c0 2.98 0.97 5.5 2.9 7.58s4.39 3.11 7.37 3.11c3.49 0 6.23-1.34 8.21-4.01s2.97-6.39 2.97-11.14c0-4.01-0.93-7.15-2.78-9.42 -1.85-2.27-4.36-3.41-7.52-3.41 -3.35 0-6.05 1.17-8.09 3.5C235.17 26.47 234.15 29.39 234.15 32.91z"/>
|
||||
<path d="M283.09 52.28c-1.36 0.75-3.15 1.12-5.38 1.12 -6.3 0-9.46-3.52-9.46-10.55v-21.3h-6.19v-4.92h6.19V7.84l5.77-1.86v10.65h9.07v4.92h-9.07v20.28c0 2.41 0.41 4.14 1.23 5.17s2.18 1.55 4.08 1.55c1.45 0 2.71-0.4 3.76-1.2V52.28z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.2 KiB |
@@ -0,0 +1,124 @@
|
||||
/// <reference path="../src/harness/external/node.d.ts" />
|
||||
/// <reference path="../built/local/typescript.d.ts" />
|
||||
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
import * as typescript from "typescript";
|
||||
declare var ts: typeof typescript;
|
||||
|
||||
var tsSourceDir = "../src";
|
||||
var tsBuildDir = "../built/local";
|
||||
var testOutputDir = "../built/benchmark";
|
||||
var sourceFiles = [
|
||||
"compiler/types.ts",
|
||||
"compiler/core.ts",
|
||||
"compiler/sys.ts",
|
||||
"compiler/diagnosticInformationMap.generated.ts",
|
||||
"compiler/scanner.ts",
|
||||
"compiler/binder.ts",
|
||||
"compiler/utilities.ts",
|
||||
"compiler/parser.ts",
|
||||
"compiler/checker.ts",
|
||||
"compiler/declarationEmitter.ts",
|
||||
"compiler/emitter.ts",
|
||||
"compiler/program.ts",
|
||||
"compiler/commandLineParser.ts",
|
||||
"compiler/tsc.ts"];
|
||||
|
||||
// .ts sources for the compiler, used as a test input
|
||||
var rawCompilerSources = "";
|
||||
sourceFiles.forEach(f=> {
|
||||
rawCompilerSources += "\r\n" + fs.readFileSync(path.join(tsSourceDir, f)).toString();
|
||||
});
|
||||
var compilerSoruces = `var compilerSources = ${JSON.stringify(rawCompilerSources) };`;
|
||||
|
||||
// .js code for the compiler, what we are actuallty testing
|
||||
var rawCompilerJavaScript = fs.readFileSync(path.join(tsBuildDir, "tsc.js")).toString();
|
||||
rawCompilerJavaScript = rawCompilerJavaScript.replace("ts.executeCommandLine(ts.sys.args);", "");
|
||||
|
||||
// lib.d.ts sources
|
||||
var rawLibSources = fs.readFileSync(path.join(tsBuildDir, "lib.d.ts")).toString();
|
||||
var libSoruces = `var libSources = ${JSON.stringify(rawLibSources) };`;
|
||||
|
||||
// write test output
|
||||
if (!fs.existsSync(testOutputDir)) {
|
||||
fs.mkdirSync(testOutputDir);
|
||||
}
|
||||
|
||||
// 1. compiler ts sources, used to test
|
||||
fs.writeFileSync(
|
||||
path.join(testOutputDir, "compilerSources.js"),
|
||||
`${ compilerSoruces } \r\n ${ libSoruces }`);
|
||||
|
||||
// 2. the compiler js sources + a call the compiler
|
||||
fs.writeFileSync(
|
||||
path.join(testOutputDir, "benchmarktsc.js"),
|
||||
`${ rawCompilerJavaScript }\r\n${ compile.toString() }\r\ncompile(compilerSources, libSources);`);
|
||||
|
||||
// 3. test html file to drive the test
|
||||
fs.writeFileSync(
|
||||
path.join(testOutputDir, "benchmarktsc.html"),
|
||||
`<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
||||
<title>Typescript 1.1 Compiler</title>
|
||||
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
|
||||
</head>
|
||||
<body>
|
||||
<div><span>Status: </span><span id="status">Running</span></div>
|
||||
<div id="main"><span>End-to-End Time: </span><span id="totalTime">N/A</span></div>
|
||||
<script>
|
||||
var startTime = performance.now();
|
||||
</script>
|
||||
<script src="compilerSources.js"></script>
|
||||
<script src="benchmarktsc.js"></script>
|
||||
<script>
|
||||
var endTime = performance.now();
|
||||
document.getElementById("totalTime").innerHTML = parseInt(endTime - startTime, 10);
|
||||
document.getElementById("status").innerHTML = "DONE";
|
||||
</script>
|
||||
</body>
|
||||
</html>`);
|
||||
|
||||
function compile(compilerSources, librarySources) {
|
||||
var program = ts.createProgram(
|
||||
["lib.d.ts", "compiler.ts"],
|
||||
{
|
||||
noResolve: true,
|
||||
out: "compiler.js",
|
||||
removeComments: true,
|
||||
target: ts.ScriptTarget.ES3
|
||||
}, {
|
||||
getDefaultLibFileName: () => "lib.d.ts",
|
||||
getSourceFile: (filename, languageVersion) => {
|
||||
var source: string;
|
||||
if (filename === "lib.d.ts") source = librarySources;
|
||||
else if (filename === "compiler.ts") source = compilerSources;
|
||||
else console.error("Unexpected read file request: " + filename);
|
||||
|
||||
return ts.createSourceFile(filename, source, languageVersion);
|
||||
},
|
||||
writeFile: (filename, data, writeByteOrderMark) => {
|
||||
if (filename !== "compiler.js")
|
||||
console.error("Unexpected write file request: " + filename);
|
||||
// console.log(data);
|
||||
},
|
||||
getCurrentDirectory: () => "",
|
||||
getCanonicalFileName: (filename) => filename,
|
||||
useCaseSensitiveFileNames: () => false,
|
||||
getNewLine: () => "\r\n"
|
||||
});
|
||||
|
||||
var emitOutput = program.emit();
|
||||
|
||||
var errors = program.getSyntacticDiagnostics()
|
||||
.concat(program.getSemanticDiagnostics())
|
||||
.concat(program.getGlobalDiagnostics())
|
||||
.concat(emitOutput.diagnostics);
|
||||
|
||||
if (errors.length) {
|
||||
console.error("Unexpected errors.");
|
||||
errors.forEach(e=> console.log(`${e.code}: ${e.messageText}`))
|
||||
}
|
||||
}
|
||||
+10
-5
@@ -239,11 +239,7 @@ module ts {
|
||||
if (symbolKind & SymbolFlags.IsContainer) {
|
||||
container = node;
|
||||
|
||||
if (lastContainer) {
|
||||
lastContainer.nextContainer = container;
|
||||
}
|
||||
|
||||
lastContainer = container;
|
||||
addToContainerChain(container);
|
||||
}
|
||||
|
||||
if (isBlockScopeContainer) {
|
||||
@@ -262,6 +258,14 @@ module ts {
|
||||
blockScopeContainer = savedBlockScopeContainer;
|
||||
}
|
||||
|
||||
function addToContainerChain(node: Node) {
|
||||
if (lastContainer) {
|
||||
lastContainer.nextContainer = node;
|
||||
}
|
||||
|
||||
lastContainer = node;
|
||||
}
|
||||
|
||||
function bindDeclaration(node: Declaration, symbolKind: SymbolFlags, symbolExcludes: SymbolFlags, isBlockScopeContainer: boolean) {
|
||||
switch (container.kind) {
|
||||
case SyntaxKind.ModuleDeclaration:
|
||||
@@ -403,6 +407,7 @@ module ts {
|
||||
default:
|
||||
if (!blockScopeContainer.locals) {
|
||||
blockScopeContainer.locals = {};
|
||||
addToContainerChain(blockScopeContainer);
|
||||
}
|
||||
declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes);
|
||||
}
|
||||
|
||||
+71
-73
@@ -114,11 +114,10 @@ module ts {
|
||||
let globalIterableType: ObjectType;
|
||||
|
||||
let anyArrayType: Type;
|
||||
let globalTypedPropertyDescriptorType: ObjectType;
|
||||
let globalClassDecoratorType: ObjectType;
|
||||
let globalParameterDecoratorType: ObjectType;
|
||||
let globalPropertyDecoratorType: ObjectType;
|
||||
let globalMethodDecoratorType: ObjectType;
|
||||
let getGlobalClassDecoratorType: () => ObjectType;
|
||||
let getGlobalParameterDecoratorType: () => ObjectType;
|
||||
let getGlobalPropertyDecoratorType: () => ObjectType;
|
||||
let getGlobalMethodDecoratorType: () => ObjectType;
|
||||
|
||||
let tupleTypes: Map<TupleType> = {};
|
||||
let unionTypes: Map<UnionType> = {};
|
||||
@@ -2516,10 +2515,11 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function getDeclaredTypeOfClass(symbol: Symbol): InterfaceType {
|
||||
function getDeclaredTypeOfClassOrInterface(symbol: Symbol): InterfaceType {
|
||||
let links = getSymbolLinks(symbol);
|
||||
if (!links.declaredType) {
|
||||
let type = links.declaredType = <InterfaceType>createObjectType(TypeFlags.Class, symbol);
|
||||
let kind = symbol.flags & SymbolFlags.Class ? TypeFlags.Class : TypeFlags.Interface;
|
||||
let type = links.declaredType = <InterfaceType>createObjectType(kind, symbol);
|
||||
let typeParameters = getTypeParametersOfClassOrInterface(symbol);
|
||||
if (typeParameters) {
|
||||
type.flags |= TypeFlags.Reference;
|
||||
@@ -2529,35 +2529,6 @@ module ts {
|
||||
(<GenericType>type).target = <GenericType>type;
|
||||
(<GenericType>type).typeArguments = type.typeParameters;
|
||||
}
|
||||
|
||||
type.declaredProperties = getNamedMembers(symbol.members);
|
||||
type.declaredCallSignatures = emptyArray;
|
||||
type.declaredConstructSignatures = emptyArray;
|
||||
type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, IndexKind.String);
|
||||
type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, IndexKind.Number);
|
||||
}
|
||||
return <InterfaceType>links.declaredType;
|
||||
}
|
||||
|
||||
function getDeclaredTypeOfInterface(symbol: Symbol): InterfaceType {
|
||||
let links = getSymbolLinks(symbol);
|
||||
if (!links.declaredType) {
|
||||
let type = links.declaredType = <InterfaceType>createObjectType(TypeFlags.Interface, symbol);
|
||||
let typeParameters = getTypeParametersOfClassOrInterface(symbol);
|
||||
if (typeParameters) {
|
||||
type.flags |= TypeFlags.Reference;
|
||||
type.typeParameters = typeParameters;
|
||||
(<GenericType>type).instantiations = {};
|
||||
(<GenericType>type).instantiations[getTypeListId(type.typeParameters)] = <GenericType>type;
|
||||
(<GenericType>type).target = <GenericType>type;
|
||||
(<GenericType>type).typeArguments = type.typeParameters;
|
||||
}
|
||||
|
||||
type.declaredProperties = getNamedMembers(symbol.members);
|
||||
type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]);
|
||||
type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]);
|
||||
type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, IndexKind.String);
|
||||
type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, IndexKind.Number);
|
||||
}
|
||||
return <InterfaceType>links.declaredType;
|
||||
}
|
||||
@@ -2613,11 +2584,8 @@ module ts {
|
||||
|
||||
function getDeclaredTypeOfSymbol(symbol: Symbol): Type {
|
||||
Debug.assert((symbol.flags & SymbolFlags.Instantiated) === 0);
|
||||
if (symbol.flags & SymbolFlags.Class) {
|
||||
return getDeclaredTypeOfClass(symbol);
|
||||
}
|
||||
if (symbol.flags & SymbolFlags.Interface) {
|
||||
return getDeclaredTypeOfInterface(symbol);
|
||||
if (symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) {
|
||||
return getDeclaredTypeOfClassOrInterface(symbol);
|
||||
}
|
||||
if (symbol.flags & SymbolFlags.TypeAlias) {
|
||||
return getDeclaredTypeOfTypeAlias(symbol);
|
||||
@@ -2666,15 +2634,28 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function resolveDeclaredMembers(type: InterfaceType): InterfaceTypeWithDeclaredMembers {
|
||||
if (!(<InterfaceTypeWithDeclaredMembers>type).declaredProperties) {
|
||||
var symbol = type.symbol;
|
||||
(<InterfaceTypeWithDeclaredMembers>type).declaredProperties = getNamedMembers(symbol.members);
|
||||
(<InterfaceTypeWithDeclaredMembers>type).declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]);
|
||||
(<InterfaceTypeWithDeclaredMembers>type).declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]);
|
||||
(<InterfaceTypeWithDeclaredMembers>type).declaredStringIndexType = getIndexTypeOfSymbol(symbol, IndexKind.String);
|
||||
(<InterfaceTypeWithDeclaredMembers>type).declaredNumberIndexType = getIndexTypeOfSymbol(symbol, IndexKind.Number);
|
||||
}
|
||||
return <InterfaceTypeWithDeclaredMembers>type;
|
||||
}
|
||||
|
||||
function resolveClassOrInterfaceMembers(type: InterfaceType): void {
|
||||
let members = type.symbol.members;
|
||||
let callSignatures = type.declaredCallSignatures;
|
||||
let constructSignatures = type.declaredConstructSignatures;
|
||||
let stringIndexType = type.declaredStringIndexType;
|
||||
let numberIndexType = type.declaredNumberIndexType;
|
||||
let baseTypes = getBaseTypes(type);
|
||||
let target = resolveDeclaredMembers(type);
|
||||
let members = target.symbol.members;
|
||||
let callSignatures = target.declaredCallSignatures;
|
||||
let constructSignatures = target.declaredConstructSignatures;
|
||||
let stringIndexType = target.declaredStringIndexType;
|
||||
let numberIndexType = target.declaredNumberIndexType;
|
||||
let baseTypes = getBaseTypes(target);
|
||||
if (baseTypes.length) {
|
||||
members = createSymbolTable(type.declaredProperties);
|
||||
members = createSymbolTable(target.declaredProperties);
|
||||
for (let baseType of baseTypes) {
|
||||
addInheritedMembers(members, getPropertiesOfObjectType(baseType));
|
||||
callSignatures = concatenate(callSignatures, getSignaturesOfType(baseType, SignatureKind.Call));
|
||||
@@ -2687,7 +2668,7 @@ module ts {
|
||||
}
|
||||
|
||||
function resolveTypeReferenceMembers(type: TypeReference): void {
|
||||
let target = type.target;
|
||||
let target = resolveDeclaredMembers(type.target);
|
||||
let mapper = createTypeMapper(target.typeParameters, type.typeArguments);
|
||||
let members = createInstantiatedSymbolTable(target.declaredProperties, mapper);
|
||||
let callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature);
|
||||
@@ -2843,7 +2824,7 @@ module ts {
|
||||
callSignatures = getSignaturesOfSymbol(symbol);
|
||||
}
|
||||
if (symbol.flags & SymbolFlags.Class) {
|
||||
let classType = getDeclaredTypeOfClass(symbol);
|
||||
let classType = getDeclaredTypeOfClassOrInterface(symbol);
|
||||
constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]);
|
||||
if (!constructSignatures.length) {
|
||||
constructSignatures = getDefaultConstructSignatures(classType);
|
||||
@@ -2956,7 +2937,7 @@ module ts {
|
||||
let type = getApparentType(current);
|
||||
if (type !== unknownType) {
|
||||
let prop = getPropertyOfType(type, name);
|
||||
if (!prop) {
|
||||
if (!prop || getDeclarationFlagsFromSymbol(prop) & (NodeFlags.Private | NodeFlags.Protected)) {
|
||||
return undefined;
|
||||
}
|
||||
if (!props) {
|
||||
@@ -3084,7 +3065,7 @@ module ts {
|
||||
function getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature {
|
||||
let links = getNodeLinks(declaration);
|
||||
if (!links.resolvedSignature) {
|
||||
let classType = declaration.kind === SyntaxKind.Constructor ? getDeclaredTypeOfClass((<ClassDeclaration>declaration.parent).symbol) : undefined;
|
||||
let classType = declaration.kind === SyntaxKind.Constructor ? getDeclaredTypeOfClassOrInterface((<ClassDeclaration>declaration.parent).symbol) : undefined;
|
||||
let typeParameters = classType ? classType.typeParameters :
|
||||
declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined;
|
||||
let parameters: Symbol[] = [];
|
||||
@@ -3788,7 +3769,7 @@ module ts {
|
||||
}
|
||||
|
||||
function combineTypeMappers(mapper1: TypeMapper, mapper2: TypeMapper): TypeMapper {
|
||||
return t => mapper2(mapper1(t));
|
||||
return t => instantiateType(mapper1(t), mapper2);
|
||||
}
|
||||
|
||||
function instantiateTypeParameter(typeParameter: TypeParameter, mapper: TypeMapper): TypeParameter {
|
||||
@@ -3859,7 +3840,7 @@ module ts {
|
||||
function instantiateType(type: Type, mapper: TypeMapper): Type {
|
||||
if (mapper !== identityMapper) {
|
||||
if (type.flags & TypeFlags.TypeParameter) {
|
||||
return mapper(type);
|
||||
return mapper(<TypeParameter>type);
|
||||
}
|
||||
if (type.flags & TypeFlags.Anonymous) {
|
||||
return type.symbol && type.symbol.flags & (SymbolFlags.Function | SymbolFlags.Method | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral) ?
|
||||
@@ -8808,24 +8789,24 @@ module ts {
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
let classSymbol = getSymbolOfNode(node.parent);
|
||||
let classConstructorType = getTypeOfSymbol(classSymbol);
|
||||
let classDecoratorType = instantiateSingleCallFunctionType(globalClassDecoratorType, [classConstructorType]);
|
||||
let classDecoratorType = instantiateSingleCallFunctionType(getGlobalClassDecoratorType(), [classConstructorType]);
|
||||
checkTypeAssignableTo(exprType, classDecoratorType, node);
|
||||
break;
|
||||
|
||||
case SyntaxKind.PropertyDeclaration:
|
||||
checkTypeAssignableTo(exprType, globalPropertyDecoratorType, node);
|
||||
checkTypeAssignableTo(exprType, getGlobalPropertyDecoratorType(), node);
|
||||
break;
|
||||
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
let methodType = getTypeOfNode(node.parent);
|
||||
let methodDecoratorType = instantiateSingleCallFunctionType(globalMethodDecoratorType, [methodType]);
|
||||
let methodDecoratorType = instantiateSingleCallFunctionType(getGlobalMethodDecoratorType(), [methodType]);
|
||||
checkTypeAssignableTo(exprType, methodDecoratorType, node);
|
||||
break;
|
||||
|
||||
case SyntaxKind.Parameter:
|
||||
checkTypeAssignableTo(exprType, globalParameterDecoratorType, node);
|
||||
checkTypeAssignableTo(exprType, getGlobalParameterDecoratorType(), node);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -9367,7 +9348,7 @@ module ts {
|
||||
}
|
||||
|
||||
if (node.condition) checkExpression(node.condition);
|
||||
if (node.iterator) checkExpression(node.iterator);
|
||||
if (node.incrementor) checkExpression(node.incrementor);
|
||||
checkSourceElement(node.statement);
|
||||
}
|
||||
|
||||
@@ -10152,7 +10133,7 @@ module ts {
|
||||
}
|
||||
|
||||
let seen: Map<{ prop: Symbol; containingType: Type }> = {};
|
||||
forEach(type.declaredProperties, p => { seen[p.name] = { prop: p, containingType: type }; });
|
||||
forEach(resolveDeclaredMembers(type).declaredProperties, p => { seen[p.name] = { prop: p, containingType: type }; });
|
||||
let ok = true;
|
||||
|
||||
for (let base of baseTypes) {
|
||||
@@ -10708,9 +10689,15 @@ module ts {
|
||||
}
|
||||
checkExternalModuleExports(container);
|
||||
|
||||
if (node.isExportEquals && languageVersion >= ScriptTarget.ES6) {
|
||||
// export assignment is deprecated in es6 or above
|
||||
grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead);
|
||||
if (node.isExportEquals) {
|
||||
if (languageVersion >= ScriptTarget.ES6) {
|
||||
// export assignment is deprecated in es6 or above
|
||||
grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead);
|
||||
}
|
||||
else if (compilerOptions.module === ModuleKind.System) {
|
||||
// system modules does not support export assignment
|
||||
grammarErrorOnNode(node, Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11533,9 +11520,11 @@ module ts {
|
||||
|
||||
function getExportNameSubstitution(symbol: Symbol, location: Node, getGeneratedNameForNode: (Node: Node) => string): string {
|
||||
if (isExternalModuleSymbol(symbol.parent)) {
|
||||
// If this is es6 or higher, just use the name of the export
|
||||
// 1. If this is es6 or higher, just use the name of the export
|
||||
// no need to qualify it.
|
||||
if (languageVersion >= ScriptTarget.ES6) {
|
||||
// 2. export mechanism for System modules is different from CJS\AMD
|
||||
// and it does not need qualifications for exports
|
||||
if (languageVersion >= ScriptTarget.ES6 || compilerOptions.module === ModuleKind.System) {
|
||||
return undefined;
|
||||
}
|
||||
return "exports." + unescapeIdentifier(symbol.name);
|
||||
@@ -11896,6 +11885,15 @@ module ts {
|
||||
return !!resolveName(location, name, SymbolFlags.Value, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined);
|
||||
}
|
||||
|
||||
function getReferencedValueDeclaration(reference: Identifier): Declaration {
|
||||
Debug.assert(!nodeIsSynthesized(reference));
|
||||
let symbol =
|
||||
getNodeLinks(reference).resolvedSymbol ||
|
||||
resolveName(reference, reference.text, SymbolFlags.Value | SymbolFlags.Alias, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined);
|
||||
|
||||
return symbol && getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration;
|
||||
}
|
||||
|
||||
function getBlockScopedVariableId(n: Identifier): number {
|
||||
Debug.assert(!nodeIsSynthesized(n));
|
||||
|
||||
@@ -11954,6 +11952,7 @@ module ts {
|
||||
resolvesToSomeValue,
|
||||
collectLinkedAliases,
|
||||
getBlockScopedVariableId,
|
||||
getReferencedValueDeclaration,
|
||||
serializeTypeOfNode,
|
||||
serializeParameterTypesOfNode,
|
||||
serializeReturnTypeOfNode,
|
||||
@@ -11987,11 +11986,10 @@ module ts {
|
||||
globalNumberType = getGlobalType("Number");
|
||||
globalBooleanType = getGlobalType("Boolean");
|
||||
globalRegExpType = getGlobalType("RegExp");
|
||||
globalTypedPropertyDescriptorType = getTypeOfGlobalSymbol(getGlobalTypeSymbol("TypedPropertyDescriptor"), 1);
|
||||
globalClassDecoratorType = getGlobalType("ClassDecorator");
|
||||
globalPropertyDecoratorType = getGlobalType("PropertyDecorator");
|
||||
globalMethodDecoratorType = getGlobalType("MethodDecorator");
|
||||
globalParameterDecoratorType = getGlobalType("ParameterDecorator");
|
||||
getGlobalClassDecoratorType = memoize(() => getGlobalType("ClassDecorator"));
|
||||
getGlobalPropertyDecoratorType = memoize(() => getGlobalType("PropertyDecorator"));
|
||||
getGlobalMethodDecoratorType = memoize(() => getGlobalType("MethodDecorator"));
|
||||
getGlobalParameterDecoratorType = memoize(() => getGlobalType("ParameterDecorator"));
|
||||
|
||||
// If we're in ES6 mode, load the TemplateStringsArray.
|
||||
// Otherwise, default to 'unknown' for the purposes of type checking in LS scenarios.
|
||||
@@ -12018,7 +12016,7 @@ module ts {
|
||||
function isReservedWordInStrictMode(node: Identifier): boolean {
|
||||
// Check that originalKeywordKind is less than LastFutureReservedWord to see if an Identifier is a strict-mode reserved word
|
||||
return (node.parserContextFlags & ParserContextFlags.StrictMode) &&
|
||||
(node.originalKeywordKind >= SyntaxKind.FirstFutureReservedWord && node.originalKeywordKind <= SyntaxKind.LastFutureReservedWord);
|
||||
(SyntaxKind.FirstFutureReservedWord <= node.originalKeywordKind && node.originalKeywordKind <= SyntaxKind.LastFutureReservedWord);
|
||||
}
|
||||
|
||||
function reportStrictModeGrammarErrorInClassDeclaration(identifier: Identifier, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any): boolean {
|
||||
@@ -12038,7 +12036,7 @@ module ts {
|
||||
let nameBindings = impotClause.namedBindings;
|
||||
if (nameBindings.kind === SyntaxKind.NamespaceImport) {
|
||||
let name = <Identifier>(<NamespaceImport>nameBindings).name;
|
||||
if (name.originalKeywordKind) {
|
||||
if (isReservedWordInStrictMode(name)) {
|
||||
let nameText = declarationNameToString(name);
|
||||
return grammarErrorOnNode(name, Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
|
||||
}
|
||||
@@ -12047,7 +12045,7 @@ module ts {
|
||||
let reportError = false;
|
||||
for (let element of (<NamedImports>nameBindings).elements) {
|
||||
let name = element.name;
|
||||
if (name.originalKeywordKind) {
|
||||
if (isReservedWordInStrictMode(name)) {
|
||||
let nameText = declarationNameToString(name);
|
||||
reportError = reportError || grammarErrorOnNode(name, Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
|
||||
}
|
||||
|
||||
@@ -58,11 +58,13 @@ module ts {
|
||||
shortName: "m",
|
||||
type: {
|
||||
"commonjs": ModuleKind.CommonJS,
|
||||
"amd": ModuleKind.AMD
|
||||
"amd": ModuleKind.AMD,
|
||||
"system": ModuleKind.System,
|
||||
"umd": ModuleKind.UMD,
|
||||
},
|
||||
description: Diagnostics.Specify_module_code_generation_Colon_commonjs_or_amd,
|
||||
description: Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_or_umd,
|
||||
paramType: Diagnostics.KIND,
|
||||
error: Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd
|
||||
error: Diagnostics.Argument_for_module_option_must_be_commonjs_amd_system_or_umd
|
||||
},
|
||||
{
|
||||
name: "noEmit",
|
||||
@@ -118,6 +120,13 @@ module ts {
|
||||
type: "boolean",
|
||||
description: Diagnostics.Do_not_emit_comments_to_output,
|
||||
},
|
||||
{
|
||||
name: "rootDir",
|
||||
type: "string",
|
||||
isFilePath: true,
|
||||
description: Diagnostics.Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir,
|
||||
paramType: Diagnostics.LOCATION,
|
||||
},
|
||||
{
|
||||
name: "separateCompilation",
|
||||
type: "boolean",
|
||||
@@ -151,7 +160,7 @@ module ts {
|
||||
type: { "es3": ScriptTarget.ES3, "es5": ScriptTarget.ES5, "es6": ScriptTarget.ES6 },
|
||||
description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental,
|
||||
paramType: Diagnostics.VERSION,
|
||||
error: Diagnostics.Argument_for_target_option_must_be_es3_es5_or_es6
|
||||
error: Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6
|
||||
},
|
||||
{
|
||||
name: "version",
|
||||
@@ -285,12 +294,27 @@ module ts {
|
||||
* Read tsconfig.json file
|
||||
* @param fileName The path to the config file
|
||||
*/
|
||||
export function readConfigFile(fileName: string): any {
|
||||
export function readConfigFile(fileName: string): { config?: any; error?: Diagnostic } {
|
||||
try {
|
||||
var text = sys.readFile(fileName);
|
||||
return /\S/.test(text) ? JSON.parse(text) : {};
|
||||
}
|
||||
catch (e) {
|
||||
return { error: createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message) };
|
||||
}
|
||||
return parseConfigFileText(fileName, text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the text of the tsconfig.json file
|
||||
* @param fileName The path to the config file
|
||||
* @param jsonText The text of the config file
|
||||
*/
|
||||
export function parseConfigFileText(fileName: string, jsonText: string): { config?: any; error?: Diagnostic } {
|
||||
try {
|
||||
return { config: /\S/.test(jsonText) ? JSON.parse(jsonText) : {} };
|
||||
}
|
||||
catch (e) {
|
||||
return { error: createCompilerDiagnostic(Diagnostics.Failed_to_parse_file_0_Colon_1, fileName, e.message) };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,7 +324,7 @@ module ts {
|
||||
* @param basePath A root directory to resolve relative path entries in the config
|
||||
* file to. e.g. outDir
|
||||
*/
|
||||
export function parseConfigFile(json: any, basePath?: string): ParsedCommandLine {
|
||||
export function parseConfigFile(json: any, host: ParseConfigHost, basePath: string): ParsedCommandLine {
|
||||
var errors: Diagnostic[] = [];
|
||||
|
||||
return {
|
||||
@@ -359,7 +383,7 @@ module ts {
|
||||
}
|
||||
}
|
||||
else {
|
||||
var sysFiles = sys.readDirectory(basePath, ".ts");
|
||||
var sysFiles = host.readDirectory(basePath, ".ts");
|
||||
for (var i = 0; i < sysFiles.length; i++) {
|
||||
var name = sysFiles[i];
|
||||
if (!fileExtensionIs(name, ".d.ts") || !contains(sysFiles, name.substr(0, name.length - 5) + ".ts")) {
|
||||
|
||||
@@ -281,6 +281,17 @@ module ts {
|
||||
return result;
|
||||
}
|
||||
|
||||
export function memoize<T>(callback: () => T): () => T {
|
||||
let value: T;
|
||||
return () => {
|
||||
if (callback) {
|
||||
value = callback();
|
||||
callback = undefined;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
}
|
||||
|
||||
function formatStringFromArgs(text: string, args: { [index: number]: any; }, baseIndex?: number): string {
|
||||
baseIndex = baseIndex || 0;
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ module ts {
|
||||
Line_terminator_not_permitted_before_arrow: { code: 1200, category: DiagnosticCategory.Error, key: "Line terminator not permitted before arrow." },
|
||||
Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_or_import_d_from_mod_instead: { code: 1202, category: DiagnosticCategory.Error, key: "Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"' or 'import d from \"mod\"' instead." },
|
||||
Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead: { code: 1203, category: DiagnosticCategory.Error, key: "Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead." },
|
||||
Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher: { code: 1204, category: DiagnosticCategory.Error, key: "Cannot compile external modules into amd or commonjs when targeting es6 or higher." },
|
||||
Cannot_compile_external_modules_into_commonjs_amd_system_or_umd_when_targeting_ES6_or_higher: { code: 1204, category: DiagnosticCategory.Error, key: "Cannot compile external modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher." },
|
||||
Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." },
|
||||
Decorators_are_not_valid_here: { code: 1206, category: DiagnosticCategory.Error, key: "Decorators are not valid here." },
|
||||
Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." },
|
||||
@@ -175,6 +175,7 @@ module ts {
|
||||
Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" },
|
||||
Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
|
||||
Type_expected_0_is_a_reserved_word_in_strict_mode_Module_is_automatically_in_strict_mode: { code: 1217, category: DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode." },
|
||||
Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: DiagnosticCategory.Error, key: "Export assignment is not supported when '--module' flag is 'system'." },
|
||||
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
|
||||
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." },
|
||||
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
|
||||
@@ -439,6 +440,7 @@ module ts {
|
||||
Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: DiagnosticCategory.Error, key: "Cannot find the common subdirectory path for the input files." },
|
||||
Cannot_read_file_0_Colon_1: { code: 5012, category: DiagnosticCategory.Error, key: "Cannot read file '{0}': {1}" },
|
||||
Unsupported_file_encoding: { code: 5013, category: DiagnosticCategory.Error, key: "Unsupported file encoding." },
|
||||
Failed_to_parse_file_0_Colon_1: { code: 5014, category: DiagnosticCategory.Error, key: "Failed to parse file '{0}': {1}." },
|
||||
Unknown_compiler_option_0: { code: 5023, category: DiagnosticCategory.Error, key: "Unknown compiler option '{0}'." },
|
||||
Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: DiagnosticCategory.Error, key: "Compiler option '{0}' requires a value of type {1}." },
|
||||
Could_not_write_file_0_Colon_1: { code: 5033, category: DiagnosticCategory.Error, key: "Could not write file '{0}': {1}" },
|
||||
@@ -467,7 +469,7 @@ module ts {
|
||||
Do_not_emit_comments_to_output: { code: 6009, category: DiagnosticCategory.Message, key: "Do not emit comments to output." },
|
||||
Do_not_emit_outputs: { code: 6010, category: DiagnosticCategory.Message, key: "Do not emit outputs." },
|
||||
Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" },
|
||||
Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs' or 'amd'" },
|
||||
Specify_module_code_generation_Colon_commonjs_amd_system_or_umd: { code: 6016, category: DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs', 'amd', 'system' or 'umd'" },
|
||||
Print_this_message: { code: 6017, category: DiagnosticCategory.Message, key: "Print this message." },
|
||||
Print_the_compiler_s_version: { code: 6019, category: DiagnosticCategory.Message, key: "Print the compiler's version." },
|
||||
Compile_the_project_in_the_given_directory: { code: 6020, category: DiagnosticCategory.Message, key: "Compile the project in the given directory." },
|
||||
@@ -488,8 +490,8 @@ module ts {
|
||||
Generates_corresponding_map_file: { code: 6043, category: DiagnosticCategory.Message, key: "Generates corresponding '.map' file." },
|
||||
Compiler_option_0_expects_an_argument: { code: 6044, category: DiagnosticCategory.Error, key: "Compiler option '{0}' expects an argument." },
|
||||
Unterminated_quoted_string_in_response_file_0: { code: 6045, category: DiagnosticCategory.Error, key: "Unterminated quoted string in response file '{0}'." },
|
||||
Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs' or 'amd'." },
|
||||
Argument_for_target_option_must_be_es3_es5_or_es6: { code: 6047, category: DiagnosticCategory.Error, key: "Argument for '--target' option must be 'es3', 'es5', or 'es6'." },
|
||||
Argument_for_module_option_must_be_commonjs_amd_system_or_umd: { code: 6046, category: DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs', 'amd', 'system' or 'umd'." },
|
||||
Argument_for_target_option_must_be_ES3_ES5_or_ES6: { code: 6047, category: DiagnosticCategory.Error, key: "Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'." },
|
||||
Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: DiagnosticCategory.Error, key: "Locale must be of the form <language> or <language>-<territory>. For example '{0}' or '{1}'." },
|
||||
Unsupported_locale_0: { code: 6049, category: DiagnosticCategory.Error, key: "Unsupported locale '{0}'." },
|
||||
Unable_to_open_file_0: { code: 6050, category: DiagnosticCategory.Error, key: "Unable to open file '{0}'." },
|
||||
@@ -500,6 +502,8 @@ module ts {
|
||||
Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: DiagnosticCategory.Message, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." },
|
||||
Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: DiagnosticCategory.Message, key: "Do not emit declarations for code that has an '@internal' annotation." },
|
||||
Preserve_new_lines_when_emitting_code: { code: 6057, category: DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." },
|
||||
Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." },
|
||||
File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { code: 6059, category: DiagnosticCategory.Error, key: "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files." },
|
||||
Variable_0_implicitly_has_an_1_type: { code: 7005, category: DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." },
|
||||
Parameter_0_implicitly_has_an_1_type: { code: 7006, category: DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." },
|
||||
Member_0_implicitly_has_an_1_type: { code: 7008, category: DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." },
|
||||
|
||||
@@ -631,7 +631,7 @@
|
||||
"category": "Error",
|
||||
"code": 1203
|
||||
},
|
||||
"Cannot compile external modules into amd or commonjs when targeting es6 or higher.": {
|
||||
"Cannot compile external modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher.": {
|
||||
"category": "Error",
|
||||
"code": 1204
|
||||
},
|
||||
@@ -687,6 +687,10 @@
|
||||
"category": "Error",
|
||||
"code": 1217
|
||||
},
|
||||
"Export assignment is not supported when '--module' flag is 'system'.": {
|
||||
"category": "Error",
|
||||
"code": 1218
|
||||
},
|
||||
"Duplicate identifier '{0}'.": {
|
||||
"category": "Error",
|
||||
"code": 2300
|
||||
@@ -1744,6 +1748,10 @@
|
||||
"category": "Error",
|
||||
"code": 5013
|
||||
},
|
||||
"Failed to parse file '{0}': {1}.": {
|
||||
"category": "Error",
|
||||
"code": 5014
|
||||
},
|
||||
"Unknown compiler option '{0}'.": {
|
||||
"category": "Error",
|
||||
"code": 5023
|
||||
@@ -1857,7 +1865,7 @@
|
||||
"category": "Message",
|
||||
"code": 6015
|
||||
},
|
||||
"Specify module code generation: 'commonjs' or 'amd'": {
|
||||
"Specify module code generation: 'commonjs', 'amd', 'system' or 'umd'": {
|
||||
"category": "Message",
|
||||
"code": 6016
|
||||
},
|
||||
@@ -1941,11 +1949,11 @@
|
||||
"category": "Error",
|
||||
"code": 6045
|
||||
},
|
||||
"Argument for '--module' option must be 'commonjs' or 'amd'.": {
|
||||
"Argument for '--module' option must be 'commonjs', 'amd', 'system' or 'umd'.": {
|
||||
"category": "Error",
|
||||
"code": 6046
|
||||
},
|
||||
"Argument for '--target' option must be 'es3', 'es5', or 'es6'.": {
|
||||
"Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'.": {
|
||||
"category": "Error",
|
||||
"code": 6047
|
||||
},
|
||||
@@ -1989,6 +1997,15 @@
|
||||
"category": "Message",
|
||||
"code": 6057
|
||||
},
|
||||
"Specifies the root directory of input files. Use to control the output directory structure with --outDir.": {
|
||||
"category": "Message",
|
||||
"code": 6058
|
||||
},
|
||||
"File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files.": {
|
||||
"category": "Error",
|
||||
"code": 6059
|
||||
},
|
||||
|
||||
|
||||
"Variable '{0}' implicitly has an '{1}' type.": {
|
||||
"category": "Error",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+732
-81
File diff suppressed because it is too large
Load Diff
@@ -194,7 +194,7 @@ module ts {
|
||||
case SyntaxKind.ForStatement:
|
||||
return visitNode(cbNode, (<ForStatement>node).initializer) ||
|
||||
visitNode(cbNode, (<ForStatement>node).condition) ||
|
||||
visitNode(cbNode, (<ForStatement>node).iterator) ||
|
||||
visitNode(cbNode, (<ForStatement>node).incrementor) ||
|
||||
visitNode(cbNode, (<ForStatement>node).statement);
|
||||
case SyntaxKind.ForInStatement:
|
||||
return visitNode(cbNode, (<ForInStatement>node).initializer) ||
|
||||
@@ -3497,7 +3497,7 @@ module ts {
|
||||
}
|
||||
parseExpected(SyntaxKind.SemicolonToken);
|
||||
if (token !== SyntaxKind.CloseParenToken) {
|
||||
forStatement.iterator = allowInAnd(parseExpression);
|
||||
forStatement.incrementor = allowInAnd(parseExpression);
|
||||
}
|
||||
parseExpected(SyntaxKind.CloseParenToken);
|
||||
forOrForInOrForOfStatement = forStatement;
|
||||
|
||||
+70
-35
@@ -455,6 +455,66 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function computeCommonSourceDirectory(sourceFiles: SourceFile[]): string {
|
||||
let commonPathComponents: string[];
|
||||
let currentDirectory = host.getCurrentDirectory();
|
||||
forEach(files, sourceFile => {
|
||||
// Each file contributes into common source file path
|
||||
if (isDeclarationFile(sourceFile)) {
|
||||
return;
|
||||
}
|
||||
|
||||
let sourcePathComponents = getNormalizedPathComponents(sourceFile.fileName, currentDirectory);
|
||||
sourcePathComponents.pop(); // The base file name is not part of the common directory path
|
||||
|
||||
if (!commonPathComponents) {
|
||||
// first file
|
||||
commonPathComponents = sourcePathComponents;
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) {
|
||||
if (commonPathComponents[i] !== sourcePathComponents[i]) {
|
||||
if (i === 0) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files));
|
||||
return;
|
||||
}
|
||||
|
||||
// New common path found that is 0 -> i-1
|
||||
commonPathComponents.length = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If the sourcePathComponents was shorter than the commonPathComponents, truncate to the sourcePathComponents
|
||||
if (sourcePathComponents.length < commonPathComponents.length) {
|
||||
commonPathComponents.length = sourcePathComponents.length;
|
||||
}
|
||||
});
|
||||
|
||||
return getNormalizedPathFromPathComponents(commonPathComponents);
|
||||
}
|
||||
|
||||
function checkSourceFilesBelongToPath(sourceFiles: SourceFile[], rootDirectory: string): boolean {
|
||||
let allFilesBelongToPath = true;
|
||||
if (sourceFiles) {
|
||||
let currentDirectory = host.getCurrentDirectory();
|
||||
let absoluteRootDirectoryPath = host.getCanonicalFileName(getNormalizedAbsolutePath(rootDirectory, currentDirectory));
|
||||
|
||||
for (var sourceFile of sourceFiles) {
|
||||
if (!isDeclarationFile(sourceFile)) {
|
||||
let absoluteSourceFilePath = host.getCanonicalFileName(getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory));
|
||||
if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, sourceFile.fileName, options.rootDir));
|
||||
allFilesBelongToPath = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return allFilesBelongToPath;
|
||||
}
|
||||
|
||||
function verifyCompilerOptions() {
|
||||
if (options.separateCompilation) {
|
||||
if (options.sourceMap) {
|
||||
@@ -526,7 +586,7 @@ module ts {
|
||||
|
||||
// Cannot specify module gen target when in es6 or above
|
||||
if (options.module && languageVersion >= ScriptTarget.ES6) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher));
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_compile_external_modules_into_commonjs_amd_system_or_umd_when_targeting_ES6_or_higher));
|
||||
}
|
||||
|
||||
// there has to be common source directory if user specified --outdir || --sourceRoot
|
||||
@@ -536,41 +596,16 @@ module ts {
|
||||
(options.mapRoot && // there is --mapRoot specified and there would be multiple js files generated
|
||||
(!options.out || firstExternalModuleSourceFile !== undefined))) {
|
||||
|
||||
let commonPathComponents: string[];
|
||||
forEach(files, sourceFile => {
|
||||
// Each file contributes into common source file path
|
||||
if (!(sourceFile.flags & NodeFlags.DeclarationFile)
|
||||
&& !fileExtensionIs(sourceFile.fileName, ".js")) {
|
||||
let sourcePathComponents = getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory());
|
||||
sourcePathComponents.pop(); // FileName is not part of directory
|
||||
if (commonPathComponents) {
|
||||
for (let i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) {
|
||||
if (commonPathComponents[i] !== sourcePathComponents[i]) {
|
||||
if (i === 0) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files));
|
||||
return;
|
||||
}
|
||||
if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) {
|
||||
// If a rootDir is specified and is valid use it as the commonSourceDirectory
|
||||
commonSourceDirectory = getNormalizedAbsolutePath(options.rootDir, host.getCurrentDirectory());
|
||||
}
|
||||
else {
|
||||
// Compute the commonSourceDirectory from the input files
|
||||
commonSourceDirectory = computeCommonSourceDirectory(files);
|
||||
}
|
||||
|
||||
// New common path found that is 0 -> i-1
|
||||
commonPathComponents.length = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If the fileComponent path completely matched and less than already found update the length
|
||||
if (sourcePathComponents.length < commonPathComponents.length) {
|
||||
commonPathComponents.length = sourcePathComponents.length;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// first file
|
||||
commonPathComponents = sourcePathComponents;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
commonSourceDirectory = getNormalizedPathFromPathComponents(commonPathComponents);
|
||||
if (commonSourceDirectory) {
|
||||
if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== directorySeparator) {
|
||||
// Make sure directory path ends with directory separator so this string can directly
|
||||
// used to replace with "" to get the relative path of the source file and the relative path doesn't
|
||||
// start with / making it rooted path
|
||||
|
||||
@@ -352,7 +352,7 @@ module ts {
|
||||
export function isLineBreak(ch: number): boolean {
|
||||
// ES5 7.3:
|
||||
// The ECMAScript line terminator characters are listed in Table 3.
|
||||
// Table 3 — Line Terminator Characters
|
||||
// Table 3: Line Terminator Characters
|
||||
// Code Unit Value Name Formal Name
|
||||
// \u000A Line Feed <LF>
|
||||
// \u000D Carriage Return <CR>
|
||||
|
||||
+8
-5
@@ -208,12 +208,15 @@ module ts {
|
||||
|
||||
if (!cachedProgram) {
|
||||
if (configFileName) {
|
||||
var configObject = readConfigFile(configFileName);
|
||||
if (!configObject) {
|
||||
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Unable_to_open_file_0, configFileName));
|
||||
|
||||
let result = readConfigFile(configFileName);
|
||||
if (result.error) {
|
||||
reportDiagnostic(result.error);
|
||||
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
|
||||
}
|
||||
var configParseResult = parseConfigFile(configObject, getDirectoryPath(configFileName));
|
||||
|
||||
let configObject = result.config;
|
||||
let configParseResult = parseConfigFile(configObject, sys, getDirectoryPath(configFileName));
|
||||
if (configParseResult.errors.length > 0) {
|
||||
reportDiagnostics(configParseResult.errors);
|
||||
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
|
||||
@@ -230,7 +233,7 @@ module ts {
|
||||
compilerHost.getSourceFile = getSourceFile;
|
||||
}
|
||||
|
||||
var compileResult = compile(rootFileNames, compilerOptions, compilerHost);
|
||||
let compileResult = compile(rootFileNames, compilerOptions, compilerHost);
|
||||
|
||||
if (!compilerOptions.watch) {
|
||||
return sys.exit(compileResult.exitStatus);
|
||||
|
||||
+17
-6
@@ -795,7 +795,7 @@ module ts {
|
||||
export interface ForStatement extends IterationStatement {
|
||||
initializer?: VariableDeclarationList | Expression;
|
||||
condition?: Expression;
|
||||
iterator?: Expression;
|
||||
incrementor?: Expression;
|
||||
}
|
||||
|
||||
export interface ForInStatement extends IterationStatement {
|
||||
@@ -1032,6 +1032,10 @@ module ts {
|
||||
getCurrentDirectory(): string;
|
||||
}
|
||||
|
||||
export interface ParseConfigHost {
|
||||
readDirectory(rootDir: string, extension: string): string[];
|
||||
}
|
||||
|
||||
export interface WriteFileCallback {
|
||||
(fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void;
|
||||
}
|
||||
@@ -1274,6 +1278,7 @@ module ts {
|
||||
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
|
||||
resolvesToSomeValue(location: Node, name: string): boolean;
|
||||
getBlockScopedVariableId(node: Identifier): number;
|
||||
getReferencedValueDeclaration(reference: Identifier): Declaration;
|
||||
serializeTypeOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string): string | string[];
|
||||
serializeParameterTypesOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string): (string | string[])[];
|
||||
serializeReturnTypeOfNode(node: Node, getGeneratedNameForNode: (Node: Node) => string): string | string[];
|
||||
@@ -1486,6 +1491,13 @@ module ts {
|
||||
// Class and interface types (TypeFlags.Class and TypeFlags.Interface)
|
||||
export interface InterfaceType extends ObjectType {
|
||||
typeParameters: TypeParameter[]; // Type parameters (undefined if non-generic)
|
||||
}
|
||||
|
||||
export interface InterfaceTypeWithBaseTypes extends InterfaceType {
|
||||
baseTypes: ObjectType[];
|
||||
}
|
||||
|
||||
export interface InterfaceTypeWithDeclaredMembers extends InterfaceType {
|
||||
declaredProperties: Symbol[]; // Declared members
|
||||
declaredCallSignatures: Signature[]; // Declared call signatures
|
||||
declaredConstructSignatures: Signature[]; // Declared construct signatures
|
||||
@@ -1493,10 +1505,6 @@ module ts {
|
||||
declaredNumberIndexType: Type; // Declared numeric index type
|
||||
}
|
||||
|
||||
export interface InterfaceTypeWithBaseTypes extends InterfaceType {
|
||||
baseTypes: ObjectType[];
|
||||
}
|
||||
|
||||
// Type references (TypeFlags.Reference)
|
||||
export interface TypeReference extends ObjectType {
|
||||
target: GenericType; // Type reference target
|
||||
@@ -1578,7 +1586,7 @@ module ts {
|
||||
|
||||
/* @internal */
|
||||
export interface TypeMapper {
|
||||
(t: Type): Type;
|
||||
(t: TypeParameter): Type;
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
@@ -1657,6 +1665,7 @@ module ts {
|
||||
preserveConstEnums?: boolean;
|
||||
project?: string;
|
||||
removeComments?: boolean;
|
||||
rootDir?: string;
|
||||
sourceMap?: boolean;
|
||||
sourceRoot?: string;
|
||||
suppressImplicitAnyIndexErrors?: boolean;
|
||||
@@ -1673,6 +1682,8 @@ module ts {
|
||||
None = 0,
|
||||
CommonJS = 1,
|
||||
AMD = 2,
|
||||
UMD = 3,
|
||||
System = 4,
|
||||
}
|
||||
|
||||
export interface LineAndCharacter {
|
||||
|
||||
@@ -775,7 +775,7 @@ module ts {
|
||||
let forStatement = <ForStatement>parent;
|
||||
return (forStatement.initializer === node && forStatement.initializer.kind !== SyntaxKind.VariableDeclarationList) ||
|
||||
forStatement.condition === node ||
|
||||
forStatement.iterator === node;
|
||||
forStatement.incrementor === node;
|
||||
case SyntaxKind.ForInStatement:
|
||||
case SyntaxKind.ForOfStatement:
|
||||
let forInStatement = <ForInStatement | ForOfStatement>parent;
|
||||
|
||||
@@ -97,7 +97,7 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
program = _program;
|
||||
}, function (settings) {
|
||||
harnessCompiler.setCompilerSettings(tcSettings);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -258,7 +258,7 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
}
|
||||
});
|
||||
|
||||
it('Correct type baselines for ' + fileName, () => {
|
||||
it('Correct type/symbol baselines for ' + fileName, () => {
|
||||
if (fileName.indexOf("APISample") >= 0) {
|
||||
return;
|
||||
}
|
||||
@@ -295,8 +295,26 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
|
||||
// Produce baselines. The first gives the types for all expressions.
|
||||
// The second gives symbols for all identifiers.
|
||||
checkBaseLines(/*isSymbolBaseLine:*/ false);
|
||||
checkBaseLines(/*isSymbolBaseLine:*/ true);
|
||||
var e1: Error, e2: Error;
|
||||
try {
|
||||
checkBaseLines(/*isSymbolBaseLine:*/ false);
|
||||
}
|
||||
catch (e) {
|
||||
e1 = e;
|
||||
}
|
||||
|
||||
try {
|
||||
checkBaseLines(/*isSymbolBaseLine:*/ true);
|
||||
}
|
||||
catch (e) {
|
||||
e2 = e;
|
||||
}
|
||||
|
||||
if (e1 || e2) {
|
||||
throw e1 || e2;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
function checkBaseLines(isSymbolBaseLine: boolean) {
|
||||
let fullBaseLine = generateBaseLine(fullResults, isSymbolBaseLine);
|
||||
|
||||
@@ -957,8 +957,12 @@ module Harness {
|
||||
if (typeof setting.value === 'string') {
|
||||
if (setting.value.toLowerCase() === 'amd') {
|
||||
options.module = ts.ModuleKind.AMD;
|
||||
} else if (setting.value.toLowerCase() === 'umd') {
|
||||
options.module = ts.ModuleKind.UMD;
|
||||
} else if (setting.value.toLowerCase() === 'commonjs') {
|
||||
options.module = ts.ModuleKind.CommonJS;
|
||||
} else if (setting.value.toLowerCase() === 'system') {
|
||||
options.module = ts.ModuleKind.System;
|
||||
} else if (setting.value.toLowerCase() === 'unspecified') {
|
||||
options.module = ts.ModuleKind.None;
|
||||
} else {
|
||||
|
||||
@@ -186,6 +186,7 @@ module Harness.LanguageService {
|
||||
var script = this.getScriptInfo(fileName);
|
||||
return script ? script.version.toString() : undefined;
|
||||
}
|
||||
|
||||
log(s: string): void { }
|
||||
trace(s: string): void { }
|
||||
error(s: string): void { }
|
||||
@@ -203,7 +204,7 @@ module Harness.LanguageService {
|
||||
}
|
||||
|
||||
/// Shim adapter
|
||||
class ShimLanguageServiceHost extends LanguageServiceAdapterHost implements ts.LanguageServiceShimHost {
|
||||
class ShimLanguageServiceHost extends LanguageServiceAdapterHost implements ts.LanguageServiceShimHost, ts.CoreServicesShimHost {
|
||||
private nativeHost: NativeLanguageServiceHost;
|
||||
constructor(cancellationToken?: ts.CancellationToken, options?: ts.CompilerOptions) {
|
||||
super(cancellationToken, options);
|
||||
@@ -227,6 +228,11 @@ module Harness.LanguageService {
|
||||
}
|
||||
getScriptVersion(fileName: string): string { return this.nativeHost.getScriptVersion(fileName); }
|
||||
getLocalizedDiagnosticMessages(): string { return JSON.stringify({}); }
|
||||
|
||||
readDirectory(rootDir: string, extension: string): string {
|
||||
throw new Error("NYI");
|
||||
}
|
||||
|
||||
log(s: string): void { this.nativeHost.log(s); }
|
||||
trace(s: string): void { this.nativeHost.trace(s); }
|
||||
error(s: string): void { this.nativeHost.error(s); }
|
||||
|
||||
@@ -18,6 +18,7 @@ interface ProjectRunnerTestCase {
|
||||
runTest?: boolean; // Run the resulting test
|
||||
bug?: string; // If there is any bug associated with this test case
|
||||
noResolve?: boolean;
|
||||
rootDir?: string; // --rootDir
|
||||
}
|
||||
|
||||
interface ProjectRunnerTestCaseResolutionInfo extends ProjectRunnerTestCase {
|
||||
@@ -160,7 +161,8 @@ class ProjectRunner extends RunnerBase {
|
||||
mapRoot: testCase.resolveMapRoot && testCase.mapRoot ? ts.sys.resolvePath(testCase.mapRoot) : testCase.mapRoot,
|
||||
sourceRoot: testCase.resolveSourceRoot && testCase.sourceRoot ? ts.sys.resolvePath(testCase.sourceRoot) : testCase.sourceRoot,
|
||||
module: moduleKind,
|
||||
noResolve: testCase.noResolve
|
||||
noResolve: testCase.noResolve,
|
||||
rootDir: testCase.rootDir
|
||||
};
|
||||
}
|
||||
|
||||
@@ -326,7 +328,9 @@ class ProjectRunner extends RunnerBase {
|
||||
return Harness.Compiler.getErrorBaseline(inputFiles, diagnostics);
|
||||
}
|
||||
|
||||
describe('Compiling project for ' + testCase.scenario + ': testcase ' + testCaseFileName, () => {
|
||||
var name = 'Compiling project for ' + testCase.scenario + ': testcase ' + testCaseFileName;
|
||||
|
||||
describe(name, () => {
|
||||
function verifyCompilerResults(compilerResult: BatchCompileProjectTestCaseResult) {
|
||||
function getCompilerResolutionInfo() {
|
||||
var resolutionInfo: ProjectRunnerTestCaseResolutionInfo = {
|
||||
@@ -344,6 +348,7 @@ class ProjectRunner extends RunnerBase {
|
||||
baselineCheck: testCase.baselineCheck,
|
||||
runTest: testCase.runTest,
|
||||
bug: testCase.bug,
|
||||
rootDir: testCase.rootDir,
|
||||
resolvedInputFiles: ts.map(compilerResult.program.getSourceFiles(), inputFile => inputFile.fileName),
|
||||
emittedFiles: ts.map(compilerResult.outputFiles, outputFile => outputFile.emittedFileName)
|
||||
};
|
||||
@@ -402,51 +407,67 @@ class ProjectRunner extends RunnerBase {
|
||||
}
|
||||
}
|
||||
|
||||
// Compile using node
|
||||
var nodeCompilerResult = batchCompilerProjectTestCase(ts.ModuleKind.CommonJS);
|
||||
verifyCompilerResults(nodeCompilerResult);
|
||||
var nodeCompilerResult: BatchCompileProjectTestCaseResult;
|
||||
var amdCompilerResult: BatchCompileProjectTestCaseResult;
|
||||
|
||||
// Compile using amd
|
||||
var amdCompilerResult = batchCompilerProjectTestCase(ts.ModuleKind.AMD);
|
||||
verifyCompilerResults(amdCompilerResult);
|
||||
it(name + ": node", () => {
|
||||
// Compile using node
|
||||
nodeCompilerResult = batchCompilerProjectTestCase(ts.ModuleKind.CommonJS);
|
||||
verifyCompilerResults(nodeCompilerResult);
|
||||
});
|
||||
|
||||
|
||||
it(name + ": amd", () => {
|
||||
// Compile using amd
|
||||
amdCompilerResult = batchCompilerProjectTestCase(ts.ModuleKind.AMD);
|
||||
verifyCompilerResults(amdCompilerResult);
|
||||
});
|
||||
|
||||
if (testCase.runTest) {
|
||||
//TODO(ryanca/danquirk): Either support this or remove this option from the interface as well as test case json files
|
||||
// Node results
|
||||
assert.isTrue(!nodeCompilerResult.nonSubfolderDiskFiles, "Cant run test case that generates parent folders/absolute path");
|
||||
//it("runs without error: (" + moduleNameToString(nodeCompilerResult.moduleKind) + ')', function (done: any) {
|
||||
// Exec.exec("node.exe", ['"' + baseLineLocalPath(nodeCompilerResult.outputFiles[0].diskRelativeName, nodeCompilerResult.moduleKind) + '"'], function (res) {
|
||||
// Harness.Assert.equal(res.stdout, "");
|
||||
// Harness.Assert.equal(res.stderr, "");
|
||||
// done();
|
||||
// })
|
||||
//});
|
||||
it(name + ": runTest", () => {
|
||||
if (!nodeCompilerResult || !amdCompilerResult) {
|
||||
return;
|
||||
}
|
||||
//TODO(ryanca/danquirk): Either support this or remove this option from the interface as well as test case json files
|
||||
// Node results
|
||||
assert.isTrue(!nodeCompilerResult.nonSubfolderDiskFiles, "Cant run test case that generates parent folders/absolute path");
|
||||
//it("runs without error: (" + moduleNameToString(nodeCompilerResult.moduleKind) + ')', function (done: any) {
|
||||
// Exec.exec("node.exe", ['"' + baseLineLocalPath(nodeCompilerResult.outputFiles[0].diskRelativeName, nodeCompilerResult.moduleKind) + '"'], function (res) {
|
||||
// Harness.Assert.equal(res.stdout, "");
|
||||
// Harness.Assert.equal(res.stderr, "");
|
||||
// done();
|
||||
// })
|
||||
//});
|
||||
|
||||
// Amd results
|
||||
assert.isTrue(!amdCompilerResult.nonSubfolderDiskFiles, "Cant run test case that generates parent folders/absolute path");
|
||||
//var amdDriverTemplate = "var requirejs = require('../r.js');\n\n" +
|
||||
// "requirejs.config({\n" +
|
||||
// " nodeRequire: require\n" +
|
||||
// "});\n\n" +
|
||||
// "requirejs(['{0}'],\n" +
|
||||
// "function ({0}) {\n" +
|
||||
// "});";
|
||||
//var moduleName = baseLineLocalPath(amdCompilerResult.outputFiles[0].diskRelativeName, amdCompilerResult.moduleKind).replace(/\.js$/, "");
|
||||
//sys.writeFile(testCase.projectRoot + '/driver.js', amdDriverTemplate.replace(/\{0}/g, moduleName));
|
||||
//it("runs without error (" + moduleNameToString(amdCompilerResult.moduleKind) + ')', function (done: any) {
|
||||
// Exec.exec("node.exe", ['"' + testCase.projectRoot + '/driver.js"'], function (res) {
|
||||
// Harness.Assert.equal(res.stdout, "");
|
||||
// Harness.Assert.equal(res.stderr, "");
|
||||
// done();
|
||||
// })
|
||||
//});
|
||||
// Amd results
|
||||
assert.isTrue(!amdCompilerResult.nonSubfolderDiskFiles, "Cant run test case that generates parent folders/absolute path");
|
||||
//var amdDriverTemplate = "var requirejs = require('../r.js');\n\n" +
|
||||
// "requirejs.config({\n" +
|
||||
// " nodeRequire: require\n" +
|
||||
// "});\n\n" +
|
||||
// "requirejs(['{0}'],\n" +
|
||||
// "function ({0}) {\n" +
|
||||
// "});";
|
||||
//var moduleName = baseLineLocalPath(amdCompilerResult.outputFiles[0].diskRelativeName, amdCompilerResult.moduleKind).replace(/\.js$/, "");
|
||||
//sys.writeFile(testCase.projectRoot + '/driver.js', amdDriverTemplate.replace(/\{0}/g, moduleName));
|
||||
//it("runs without error (" + moduleNameToString(amdCompilerResult.moduleKind) + ')', function (done: any) {
|
||||
// Exec.exec("node.exe", ['"' + testCase.projectRoot + '/driver.js"'], function (res) {
|
||||
// Harness.Assert.equal(res.stdout, "");
|
||||
// Harness.Assert.equal(res.stderr, "");
|
||||
// done();
|
||||
// })
|
||||
//});
|
||||
});
|
||||
|
||||
after(() => {
|
||||
nodeCompilerResult = undefined;
|
||||
amdCompilerResult = undefined;
|
||||
});
|
||||
}
|
||||
|
||||
after(() => {
|
||||
// Mocha holds onto the closure environment of the describe callback even after the test is done.
|
||||
// Therefore we have to clean out large objects after the test is done.
|
||||
nodeCompilerResult = undefined;
|
||||
amdCompilerResult = undefined;
|
||||
testCase = undefined;
|
||||
testFileText = undefined;
|
||||
testCaseJustName = undefined;
|
||||
|
||||
Vendored
+1
-1
@@ -546,7 +546,7 @@ interface Math {
|
||||
*/
|
||||
atan(x: number): number;
|
||||
/**
|
||||
* Returns the angle (in radians) from the X axis to a point (y,x).
|
||||
* Returns the angle (in radians) from the X axis to a point.
|
||||
* @param y A numeric expression representing the cartesian y-coordinate.
|
||||
* @param x A numeric expression representing the cartesian x-coordinate.
|
||||
*/
|
||||
|
||||
Vendored
+1
-1
@@ -442,7 +442,7 @@ interface IteratorResult<T> {
|
||||
}
|
||||
|
||||
interface Iterator<T> {
|
||||
next(): IteratorResult<T>;
|
||||
next(value?: any): IteratorResult<T>;
|
||||
return?(value?: any): IteratorResult<T>;
|
||||
throw?(e?: any): IteratorResult<T>;
|
||||
}
|
||||
|
||||
@@ -910,7 +910,7 @@ module ts.server {
|
||||
return { errorMsg: "tsconfig syntax error" };
|
||||
}
|
||||
else {
|
||||
var parsedCommandLine = ts.parseConfigFile(rawConfig, dirPath);
|
||||
var parsedCommandLine = ts.parseConfigFile(rawConfig, ts.sys, dirPath);
|
||||
if (parsedCommandLine.errors && (parsedCommandLine.errors.length > 0)) {
|
||||
return { errorMsg: "tsconfig option errors" };
|
||||
}
|
||||
|
||||
@@ -527,6 +527,9 @@ module ts.server {
|
||||
if (lineText.charAt(i) == " ") {
|
||||
indentPosition--;
|
||||
}
|
||||
else if (lineText.charAt(i) == "\t") {
|
||||
indentPosition -= editorOptions.IndentSize;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -401,8 +401,8 @@ module ts.BreakpointResolver {
|
||||
if (forStatement.condition) {
|
||||
return textSpan(forStatement.condition);
|
||||
}
|
||||
if (forStatement.iterator) {
|
||||
return textSpan(forStatement.iterator);
|
||||
if (forStatement.incrementor) {
|
||||
return textSpan(forStatement.incrementor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -458,7 +458,11 @@ module ts.formatting {
|
||||
case SyntaxKind.BinaryExpression:
|
||||
case SyntaxKind.ConditionalExpression:
|
||||
return true;
|
||||
|
||||
|
||||
// equals in binding elements: function foo([[x, y] = [1, 2]])
|
||||
case SyntaxKind.BindingElement:
|
||||
// equals in type X = ...
|
||||
case SyntaxKind.TypeAliasDeclaration:
|
||||
// equal in import a = module('a');
|
||||
case SyntaxKind.ImportEqualsDeclaration:
|
||||
// equal in let a = 0;
|
||||
@@ -475,8 +479,6 @@ module ts.formatting {
|
||||
// Technically, "of" is not a binary operator, but format it the same way as "in"
|
||||
case SyntaxKind.ForOfStatement:
|
||||
return context.currentTokenSpan.kind === SyntaxKind.OfKeyword || context.nextTokenSpan.kind === SyntaxKind.OfKeyword;
|
||||
case SyntaxKind.BindingElement:
|
||||
return context.currentTokenSpan.kind === SyntaxKind.EqualsToken || context.nextTokenSpan.kind === SyntaxKind.EqualsToken;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
+51
-5
@@ -57,6 +57,12 @@ module ts {
|
||||
getNewLine?(): string;
|
||||
}
|
||||
|
||||
/** Public interface of the the of a config service shim instance.*/
|
||||
export interface CoreServicesShimHost extends Logger {
|
||||
/** Returns a JSON-encoded value of the type: string[] */
|
||||
readDirectory(rootDir: string, extension: string): string;
|
||||
}
|
||||
|
||||
///
|
||||
/// Pre-processing
|
||||
///
|
||||
@@ -77,7 +83,7 @@ module ts {
|
||||
export interface Shim {
|
||||
dispose(dummy: any): void;
|
||||
}
|
||||
|
||||
|
||||
export interface LanguageServiceShim extends Shim {
|
||||
languageService: LanguageService;
|
||||
|
||||
@@ -188,6 +194,7 @@ module ts {
|
||||
|
||||
export interface CoreServicesShim extends Shim {
|
||||
getPreProcessedFileInfo(fileName: string, sourceText: IScriptSnapshot): string;
|
||||
getTSConfigFileInfo(fileName: string, sourceText: IScriptSnapshot): string;
|
||||
getDefaultCompilationSettings(): string;
|
||||
}
|
||||
|
||||
@@ -302,6 +309,17 @@ module ts {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class CoreServicesShimHostAdapter implements ParseConfigHost {
|
||||
|
||||
constructor(private shimHost: CoreServicesShimHost) {
|
||||
}
|
||||
|
||||
public readDirectory(rootDir: string, extension: string): string[] {
|
||||
var encoded = this.shimHost.readDirectory(rootDir, extension);
|
||||
return JSON.parse(encoded);
|
||||
}
|
||||
}
|
||||
|
||||
function simpleForwardCall(logger: Logger, actionDescription: string, action: () => any): any {
|
||||
logger.log(actionDescription);
|
||||
@@ -741,7 +759,8 @@ module ts {
|
||||
}
|
||||
|
||||
class CoreServicesShimObject extends ShimBase implements CoreServicesShim {
|
||||
constructor(factory: ShimFactory, public logger: Logger) {
|
||||
|
||||
constructor(factory: ShimFactory, public logger: Logger, private host: CoreServicesShimHostAdapter) {
|
||||
super(factory);
|
||||
}
|
||||
|
||||
@@ -779,6 +798,32 @@ module ts {
|
||||
});
|
||||
}
|
||||
|
||||
public getTSConfigFileInfo(fileName: string, sourceTextSnapshot: IScriptSnapshot): string {
|
||||
return this.forwardJSONCall(
|
||||
"getTSConfigFileInfo('" + fileName + "')",
|
||||
() => {
|
||||
let text = sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength());
|
||||
|
||||
let result = parseConfigFileText(fileName, text);
|
||||
|
||||
if (result.error) {
|
||||
return {
|
||||
options: {},
|
||||
files: [],
|
||||
errors: [realizeDiagnostic(result.error, '\r\n')]
|
||||
};
|
||||
}
|
||||
|
||||
var configFile = parseConfigFile(result.config, this.host, getDirectoryPath(normalizeSlashes(fileName)));
|
||||
|
||||
return {
|
||||
options: configFile.options,
|
||||
files: configFile.fileNames,
|
||||
errors: realizeDiagnostics(configFile.errors, '\r\n')
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
public getDefaultCompilationSettings(): string {
|
||||
return this.forwardJSONCall(
|
||||
"getDefaultCompilationSettings()",
|
||||
@@ -821,12 +866,13 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
public createCoreServicesShim(logger: Logger): CoreServicesShim {
|
||||
public createCoreServicesShim(host: CoreServicesShimHost): CoreServicesShim {
|
||||
try {
|
||||
return new CoreServicesShimObject(this, logger);
|
||||
var adapter = new CoreServicesShimHostAdapter(host);
|
||||
return new CoreServicesShimObject(this, <Logger>host, adapter);
|
||||
}
|
||||
catch (err) {
|
||||
logInternalError(logger, err);
|
||||
logInternalError(<Logger>host, err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,72 @@
|
||||
//// [baseTypeWrappingInstantiationChain.ts]
|
||||
class C<T1> extends CBase<T1> {
|
||||
public works() {
|
||||
new CBaseBase<Wrapper<T1>>(this);
|
||||
}
|
||||
public alsoWorks() {
|
||||
new CBase<T1>(this); // Should not error, parameter is of type Parameter<Wrapper<T1>>
|
||||
}
|
||||
|
||||
public method(t: Wrapper<T1>) { }
|
||||
}
|
||||
|
||||
class CBase<T2> extends CBaseBase<Wrapper<T2>> {
|
||||
|
||||
}
|
||||
|
||||
class CBaseBase<T3> {
|
||||
constructor(x: Parameter<T3>) { }
|
||||
}
|
||||
|
||||
class Parameter<T4> {
|
||||
method(t: T4) { }
|
||||
}
|
||||
|
||||
class Wrapper<T5> {
|
||||
property: T5;
|
||||
}
|
||||
|
||||
//// [baseTypeWrappingInstantiationChain.js]
|
||||
var __extends = this.__extends || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
};
|
||||
var C = (function (_super) {
|
||||
__extends(C, _super);
|
||||
function C() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
C.prototype.works = function () {
|
||||
new CBaseBase(this);
|
||||
};
|
||||
C.prototype.alsoWorks = function () {
|
||||
new CBase(this); // Should not error, parameter is of type Parameter<Wrapper<T1>>
|
||||
};
|
||||
C.prototype.method = function (t) { };
|
||||
return C;
|
||||
})(CBase);
|
||||
var CBase = (function (_super) {
|
||||
__extends(CBase, _super);
|
||||
function CBase() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return CBase;
|
||||
})(CBaseBase);
|
||||
var CBaseBase = (function () {
|
||||
function CBaseBase(x) {
|
||||
}
|
||||
return CBaseBase;
|
||||
})();
|
||||
var Parameter = (function () {
|
||||
function Parameter() {
|
||||
}
|
||||
Parameter.prototype.method = function (t) { };
|
||||
return Parameter;
|
||||
})();
|
||||
var Wrapper = (function () {
|
||||
function Wrapper() {
|
||||
}
|
||||
return Wrapper;
|
||||
})();
|
||||
@@ -0,0 +1,69 @@
|
||||
=== tests/cases/compiler/baseTypeWrappingInstantiationChain.ts ===
|
||||
class C<T1> extends CBase<T1> {
|
||||
>C : Symbol(C, Decl(baseTypeWrappingInstantiationChain.ts, 0, 0))
|
||||
>T1 : Symbol(T1, Decl(baseTypeWrappingInstantiationChain.ts, 0, 8))
|
||||
>CBase : Symbol(CBase, Decl(baseTypeWrappingInstantiationChain.ts, 9, 1))
|
||||
>T1 : Symbol(T1, Decl(baseTypeWrappingInstantiationChain.ts, 0, 8))
|
||||
|
||||
public works() {
|
||||
>works : Symbol(works, Decl(baseTypeWrappingInstantiationChain.ts, 0, 31))
|
||||
|
||||
new CBaseBase<Wrapper<T1>>(this);
|
||||
>CBaseBase : Symbol(CBaseBase, Decl(baseTypeWrappingInstantiationChain.ts, 13, 1))
|
||||
>Wrapper : Symbol(Wrapper, Decl(baseTypeWrappingInstantiationChain.ts, 21, 1))
|
||||
>T1 : Symbol(T1, Decl(baseTypeWrappingInstantiationChain.ts, 0, 8))
|
||||
>this : Symbol(C, Decl(baseTypeWrappingInstantiationChain.ts, 0, 0))
|
||||
}
|
||||
public alsoWorks() {
|
||||
>alsoWorks : Symbol(alsoWorks, Decl(baseTypeWrappingInstantiationChain.ts, 3, 5))
|
||||
|
||||
new CBase<T1>(this); // Should not error, parameter is of type Parameter<Wrapper<T1>>
|
||||
>CBase : Symbol(CBase, Decl(baseTypeWrappingInstantiationChain.ts, 9, 1))
|
||||
>T1 : Symbol(T1, Decl(baseTypeWrappingInstantiationChain.ts, 0, 8))
|
||||
>this : Symbol(C, Decl(baseTypeWrappingInstantiationChain.ts, 0, 0))
|
||||
}
|
||||
|
||||
public method(t: Wrapper<T1>) { }
|
||||
>method : Symbol(method, Decl(baseTypeWrappingInstantiationChain.ts, 6, 5))
|
||||
>t : Symbol(t, Decl(baseTypeWrappingInstantiationChain.ts, 8, 18))
|
||||
>Wrapper : Symbol(Wrapper, Decl(baseTypeWrappingInstantiationChain.ts, 21, 1))
|
||||
>T1 : Symbol(T1, Decl(baseTypeWrappingInstantiationChain.ts, 0, 8))
|
||||
}
|
||||
|
||||
class CBase<T2> extends CBaseBase<Wrapper<T2>> {
|
||||
>CBase : Symbol(CBase, Decl(baseTypeWrappingInstantiationChain.ts, 9, 1))
|
||||
>T2 : Symbol(T2, Decl(baseTypeWrappingInstantiationChain.ts, 11, 12))
|
||||
>CBaseBase : Symbol(CBaseBase, Decl(baseTypeWrappingInstantiationChain.ts, 13, 1))
|
||||
>Wrapper : Symbol(Wrapper, Decl(baseTypeWrappingInstantiationChain.ts, 21, 1))
|
||||
>T2 : Symbol(T2, Decl(baseTypeWrappingInstantiationChain.ts, 11, 12))
|
||||
|
||||
}
|
||||
|
||||
class CBaseBase<T3> {
|
||||
>CBaseBase : Symbol(CBaseBase, Decl(baseTypeWrappingInstantiationChain.ts, 13, 1))
|
||||
>T3 : Symbol(T3, Decl(baseTypeWrappingInstantiationChain.ts, 15, 16))
|
||||
|
||||
constructor(x: Parameter<T3>) { }
|
||||
>x : Symbol(x, Decl(baseTypeWrappingInstantiationChain.ts, 16, 16))
|
||||
>Parameter : Symbol(Parameter, Decl(baseTypeWrappingInstantiationChain.ts, 17, 1))
|
||||
>T3 : Symbol(T3, Decl(baseTypeWrappingInstantiationChain.ts, 15, 16))
|
||||
}
|
||||
|
||||
class Parameter<T4> {
|
||||
>Parameter : Symbol(Parameter, Decl(baseTypeWrappingInstantiationChain.ts, 17, 1))
|
||||
>T4 : Symbol(T4, Decl(baseTypeWrappingInstantiationChain.ts, 19, 16))
|
||||
|
||||
method(t: T4) { }
|
||||
>method : Symbol(method, Decl(baseTypeWrappingInstantiationChain.ts, 19, 21))
|
||||
>t : Symbol(t, Decl(baseTypeWrappingInstantiationChain.ts, 20, 11))
|
||||
>T4 : Symbol(T4, Decl(baseTypeWrappingInstantiationChain.ts, 19, 16))
|
||||
}
|
||||
|
||||
class Wrapper<T5> {
|
||||
>Wrapper : Symbol(Wrapper, Decl(baseTypeWrappingInstantiationChain.ts, 21, 1))
|
||||
>T5 : Symbol(T5, Decl(baseTypeWrappingInstantiationChain.ts, 23, 14))
|
||||
|
||||
property: T5;
|
||||
>property : Symbol(property, Decl(baseTypeWrappingInstantiationChain.ts, 23, 19))
|
||||
>T5 : Symbol(T5, Decl(baseTypeWrappingInstantiationChain.ts, 23, 14))
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
=== tests/cases/compiler/baseTypeWrappingInstantiationChain.ts ===
|
||||
class C<T1> extends CBase<T1> {
|
||||
>C : C<T1>
|
||||
>T1 : T1
|
||||
>CBase : CBase<T2>
|
||||
>T1 : T1
|
||||
|
||||
public works() {
|
||||
>works : () => void
|
||||
|
||||
new CBaseBase<Wrapper<T1>>(this);
|
||||
>new CBaseBase<Wrapper<T1>>(this) : CBaseBase<Wrapper<T1>>
|
||||
>CBaseBase : typeof CBaseBase
|
||||
>Wrapper : Wrapper<T5>
|
||||
>T1 : T1
|
||||
>this : C<T1>
|
||||
}
|
||||
public alsoWorks() {
|
||||
>alsoWorks : () => void
|
||||
|
||||
new CBase<T1>(this); // Should not error, parameter is of type Parameter<Wrapper<T1>>
|
||||
>new CBase<T1>(this) : CBase<T1>
|
||||
>CBase : typeof CBase
|
||||
>T1 : T1
|
||||
>this : C<T1>
|
||||
}
|
||||
|
||||
public method(t: Wrapper<T1>) { }
|
||||
>method : (t: Wrapper<T1>) => void
|
||||
>t : Wrapper<T1>
|
||||
>Wrapper : Wrapper<T5>
|
||||
>T1 : T1
|
||||
}
|
||||
|
||||
class CBase<T2> extends CBaseBase<Wrapper<T2>> {
|
||||
>CBase : CBase<T2>
|
||||
>T2 : T2
|
||||
>CBaseBase : CBaseBase<T3>
|
||||
>Wrapper : Wrapper<T5>
|
||||
>T2 : T2
|
||||
|
||||
}
|
||||
|
||||
class CBaseBase<T3> {
|
||||
>CBaseBase : CBaseBase<T3>
|
||||
>T3 : T3
|
||||
|
||||
constructor(x: Parameter<T3>) { }
|
||||
>x : Parameter<T3>
|
||||
>Parameter : Parameter<T4>
|
||||
>T3 : T3
|
||||
}
|
||||
|
||||
class Parameter<T4> {
|
||||
>Parameter : Parameter<T4>
|
||||
>T4 : T4
|
||||
|
||||
method(t: T4) { }
|
||||
>method : (t: T4) => void
|
||||
>t : T4
|
||||
>T4 : T4
|
||||
}
|
||||
|
||||
class Wrapper<T5> {
|
||||
>Wrapper : Wrapper<T5>
|
||||
>T5 : T5
|
||||
|
||||
property: T5;
|
||||
>property : T5
|
||||
>T5 : T5
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
//// [circularTypeAliasForUnionWithClass.ts]
|
||||
var v0: T0;
|
||||
type T0 = string | I0;
|
||||
class I0 {
|
||||
x: T0;
|
||||
}
|
||||
|
||||
var v3: T3;
|
||||
type T3 = string | I3;
|
||||
class I3 {
|
||||
[x: number]: T3;
|
||||
}
|
||||
|
||||
var v4: T4;
|
||||
type T4 = string | I4;
|
||||
class I4 {
|
||||
[x: string]: T4;
|
||||
}
|
||||
|
||||
|
||||
//// [circularTypeAliasForUnionWithClass.js]
|
||||
var v0;
|
||||
var I0 = (function () {
|
||||
function I0() {
|
||||
}
|
||||
return I0;
|
||||
})();
|
||||
var v3;
|
||||
var I3 = (function () {
|
||||
function I3() {
|
||||
}
|
||||
return I3;
|
||||
})();
|
||||
var v4;
|
||||
var I4 = (function () {
|
||||
function I4() {
|
||||
}
|
||||
return I4;
|
||||
})();
|
||||
@@ -0,0 +1,49 @@
|
||||
=== tests/cases/conformance/types/typeAliases/circularTypeAliasForUnionWithClass.ts ===
|
||||
var v0: T0;
|
||||
>v0 : Symbol(v0, Decl(circularTypeAliasForUnionWithClass.ts, 0, 3))
|
||||
>T0 : Symbol(T0, Decl(circularTypeAliasForUnionWithClass.ts, 0, 11))
|
||||
|
||||
type T0 = string | I0;
|
||||
>T0 : Symbol(T0, Decl(circularTypeAliasForUnionWithClass.ts, 0, 11))
|
||||
>I0 : Symbol(I0, Decl(circularTypeAliasForUnionWithClass.ts, 1, 22))
|
||||
|
||||
class I0 {
|
||||
>I0 : Symbol(I0, Decl(circularTypeAliasForUnionWithClass.ts, 1, 22))
|
||||
|
||||
x: T0;
|
||||
>x : Symbol(x, Decl(circularTypeAliasForUnionWithClass.ts, 2, 10))
|
||||
>T0 : Symbol(T0, Decl(circularTypeAliasForUnionWithClass.ts, 0, 11))
|
||||
}
|
||||
|
||||
var v3: T3;
|
||||
>v3 : Symbol(v3, Decl(circularTypeAliasForUnionWithClass.ts, 6, 3))
|
||||
>T3 : Symbol(T3, Decl(circularTypeAliasForUnionWithClass.ts, 6, 11))
|
||||
|
||||
type T3 = string | I3;
|
||||
>T3 : Symbol(T3, Decl(circularTypeAliasForUnionWithClass.ts, 6, 11))
|
||||
>I3 : Symbol(I3, Decl(circularTypeAliasForUnionWithClass.ts, 7, 22))
|
||||
|
||||
class I3 {
|
||||
>I3 : Symbol(I3, Decl(circularTypeAliasForUnionWithClass.ts, 7, 22))
|
||||
|
||||
[x: number]: T3;
|
||||
>x : Symbol(x, Decl(circularTypeAliasForUnionWithClass.ts, 9, 5))
|
||||
>T3 : Symbol(T3, Decl(circularTypeAliasForUnionWithClass.ts, 6, 11))
|
||||
}
|
||||
|
||||
var v4: T4;
|
||||
>v4 : Symbol(v4, Decl(circularTypeAliasForUnionWithClass.ts, 12, 3))
|
||||
>T4 : Symbol(T4, Decl(circularTypeAliasForUnionWithClass.ts, 12, 11))
|
||||
|
||||
type T4 = string | I4;
|
||||
>T4 : Symbol(T4, Decl(circularTypeAliasForUnionWithClass.ts, 12, 11))
|
||||
>I4 : Symbol(I4, Decl(circularTypeAliasForUnionWithClass.ts, 13, 22))
|
||||
|
||||
class I4 {
|
||||
>I4 : Symbol(I4, Decl(circularTypeAliasForUnionWithClass.ts, 13, 22))
|
||||
|
||||
[x: string]: T4;
|
||||
>x : Symbol(x, Decl(circularTypeAliasForUnionWithClass.ts, 15, 5))
|
||||
>T4 : Symbol(T4, Decl(circularTypeAliasForUnionWithClass.ts, 12, 11))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
=== tests/cases/conformance/types/typeAliases/circularTypeAliasForUnionWithClass.ts ===
|
||||
var v0: T0;
|
||||
>v0 : string | I0
|
||||
>T0 : string | I0
|
||||
|
||||
type T0 = string | I0;
|
||||
>T0 : string | I0
|
||||
>I0 : I0
|
||||
|
||||
class I0 {
|
||||
>I0 : I0
|
||||
|
||||
x: T0;
|
||||
>x : string | I0
|
||||
>T0 : string | I0
|
||||
}
|
||||
|
||||
var v3: T3;
|
||||
>v3 : string | I3
|
||||
>T3 : string | I3
|
||||
|
||||
type T3 = string | I3;
|
||||
>T3 : string | I3
|
||||
>I3 : I3
|
||||
|
||||
class I3 {
|
||||
>I3 : I3
|
||||
|
||||
[x: number]: T3;
|
||||
>x : number
|
||||
>T3 : string | I3
|
||||
}
|
||||
|
||||
var v4: T4;
|
||||
>v4 : string | I4
|
||||
>T4 : string | I4
|
||||
|
||||
type T4 = string | I4;
|
||||
>T4 : string | I4
|
||||
>I4 : I4
|
||||
|
||||
class I4 {
|
||||
>I4 : I4
|
||||
|
||||
[x: string]: T4;
|
||||
>x : string
|
||||
>T4 : string | I4
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
//// [circularTypeAliasForUnionWithInterface.ts]
|
||||
var v0: T0;
|
||||
type T0 = string | I0;
|
||||
interface I0 {
|
||||
x: T0;
|
||||
}
|
||||
|
||||
var v1: T1;
|
||||
type T1 = string | I1;
|
||||
interface I1 {
|
||||
(): T1;
|
||||
}
|
||||
|
||||
var v2: T2;
|
||||
type T2 = string | I2;
|
||||
interface I2 {
|
||||
new (): T2;
|
||||
}
|
||||
|
||||
var v3: T3;
|
||||
type T3 = string | I3;
|
||||
interface I3 {
|
||||
[x: number]: T3;
|
||||
}
|
||||
|
||||
var v4: T4;
|
||||
type T4 = string | I4;
|
||||
interface I4 {
|
||||
[x: string]: T4;
|
||||
}
|
||||
|
||||
|
||||
//// [circularTypeAliasForUnionWithInterface.js]
|
||||
var v0;
|
||||
var v1;
|
||||
var v2;
|
||||
var v3;
|
||||
var v4;
|
||||
@@ -0,0 +1,79 @@
|
||||
=== tests/cases/conformance/types/typeAliases/circularTypeAliasForUnionWithInterface.ts ===
|
||||
var v0: T0;
|
||||
>v0 : Symbol(v0, Decl(circularTypeAliasForUnionWithInterface.ts, 0, 3))
|
||||
>T0 : Symbol(T0, Decl(circularTypeAliasForUnionWithInterface.ts, 0, 11))
|
||||
|
||||
type T0 = string | I0;
|
||||
>T0 : Symbol(T0, Decl(circularTypeAliasForUnionWithInterface.ts, 0, 11))
|
||||
>I0 : Symbol(I0, Decl(circularTypeAliasForUnionWithInterface.ts, 1, 22))
|
||||
|
||||
interface I0 {
|
||||
>I0 : Symbol(I0, Decl(circularTypeAliasForUnionWithInterface.ts, 1, 22))
|
||||
|
||||
x: T0;
|
||||
>x : Symbol(x, Decl(circularTypeAliasForUnionWithInterface.ts, 2, 14))
|
||||
>T0 : Symbol(T0, Decl(circularTypeAliasForUnionWithInterface.ts, 0, 11))
|
||||
}
|
||||
|
||||
var v1: T1;
|
||||
>v1 : Symbol(v1, Decl(circularTypeAliasForUnionWithInterface.ts, 6, 3))
|
||||
>T1 : Symbol(T1, Decl(circularTypeAliasForUnionWithInterface.ts, 6, 11))
|
||||
|
||||
type T1 = string | I1;
|
||||
>T1 : Symbol(T1, Decl(circularTypeAliasForUnionWithInterface.ts, 6, 11))
|
||||
>I1 : Symbol(I1, Decl(circularTypeAliasForUnionWithInterface.ts, 7, 22))
|
||||
|
||||
interface I1 {
|
||||
>I1 : Symbol(I1, Decl(circularTypeAliasForUnionWithInterface.ts, 7, 22))
|
||||
|
||||
(): T1;
|
||||
>T1 : Symbol(T1, Decl(circularTypeAliasForUnionWithInterface.ts, 6, 11))
|
||||
}
|
||||
|
||||
var v2: T2;
|
||||
>v2 : Symbol(v2, Decl(circularTypeAliasForUnionWithInterface.ts, 12, 3))
|
||||
>T2 : Symbol(T2, Decl(circularTypeAliasForUnionWithInterface.ts, 12, 11))
|
||||
|
||||
type T2 = string | I2;
|
||||
>T2 : Symbol(T2, Decl(circularTypeAliasForUnionWithInterface.ts, 12, 11))
|
||||
>I2 : Symbol(I2, Decl(circularTypeAliasForUnionWithInterface.ts, 13, 22))
|
||||
|
||||
interface I2 {
|
||||
>I2 : Symbol(I2, Decl(circularTypeAliasForUnionWithInterface.ts, 13, 22))
|
||||
|
||||
new (): T2;
|
||||
>T2 : Symbol(T2, Decl(circularTypeAliasForUnionWithInterface.ts, 12, 11))
|
||||
}
|
||||
|
||||
var v3: T3;
|
||||
>v3 : Symbol(v3, Decl(circularTypeAliasForUnionWithInterface.ts, 18, 3))
|
||||
>T3 : Symbol(T3, Decl(circularTypeAliasForUnionWithInterface.ts, 18, 11))
|
||||
|
||||
type T3 = string | I3;
|
||||
>T3 : Symbol(T3, Decl(circularTypeAliasForUnionWithInterface.ts, 18, 11))
|
||||
>I3 : Symbol(I3, Decl(circularTypeAliasForUnionWithInterface.ts, 19, 22))
|
||||
|
||||
interface I3 {
|
||||
>I3 : Symbol(I3, Decl(circularTypeAliasForUnionWithInterface.ts, 19, 22))
|
||||
|
||||
[x: number]: T3;
|
||||
>x : Symbol(x, Decl(circularTypeAliasForUnionWithInterface.ts, 21, 5))
|
||||
>T3 : Symbol(T3, Decl(circularTypeAliasForUnionWithInterface.ts, 18, 11))
|
||||
}
|
||||
|
||||
var v4: T4;
|
||||
>v4 : Symbol(v4, Decl(circularTypeAliasForUnionWithInterface.ts, 24, 3))
|
||||
>T4 : Symbol(T4, Decl(circularTypeAliasForUnionWithInterface.ts, 24, 11))
|
||||
|
||||
type T4 = string | I4;
|
||||
>T4 : Symbol(T4, Decl(circularTypeAliasForUnionWithInterface.ts, 24, 11))
|
||||
>I4 : Symbol(I4, Decl(circularTypeAliasForUnionWithInterface.ts, 25, 22))
|
||||
|
||||
interface I4 {
|
||||
>I4 : Symbol(I4, Decl(circularTypeAliasForUnionWithInterface.ts, 25, 22))
|
||||
|
||||
[x: string]: T4;
|
||||
>x : Symbol(x, Decl(circularTypeAliasForUnionWithInterface.ts, 27, 5))
|
||||
>T4 : Symbol(T4, Decl(circularTypeAliasForUnionWithInterface.ts, 24, 11))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
=== tests/cases/conformance/types/typeAliases/circularTypeAliasForUnionWithInterface.ts ===
|
||||
var v0: T0;
|
||||
>v0 : string | I0
|
||||
>T0 : string | I0
|
||||
|
||||
type T0 = string | I0;
|
||||
>T0 : string | I0
|
||||
>I0 : I0
|
||||
|
||||
interface I0 {
|
||||
>I0 : I0
|
||||
|
||||
x: T0;
|
||||
>x : string | I0
|
||||
>T0 : string | I0
|
||||
}
|
||||
|
||||
var v1: T1;
|
||||
>v1 : string | I1
|
||||
>T1 : string | I1
|
||||
|
||||
type T1 = string | I1;
|
||||
>T1 : string | I1
|
||||
>I1 : I1
|
||||
|
||||
interface I1 {
|
||||
>I1 : I1
|
||||
|
||||
(): T1;
|
||||
>T1 : string | I1
|
||||
}
|
||||
|
||||
var v2: T2;
|
||||
>v2 : string | I2
|
||||
>T2 : string | I2
|
||||
|
||||
type T2 = string | I2;
|
||||
>T2 : string | I2
|
||||
>I2 : I2
|
||||
|
||||
interface I2 {
|
||||
>I2 : I2
|
||||
|
||||
new (): T2;
|
||||
>T2 : string | I2
|
||||
}
|
||||
|
||||
var v3: T3;
|
||||
>v3 : string | I3
|
||||
>T3 : string | I3
|
||||
|
||||
type T3 = string | I3;
|
||||
>T3 : string | I3
|
||||
>I3 : I3
|
||||
|
||||
interface I3 {
|
||||
>I3 : I3
|
||||
|
||||
[x: number]: T3;
|
||||
>x : number
|
||||
>T3 : string | I3
|
||||
}
|
||||
|
||||
var v4: T4;
|
||||
>v4 : string | I4
|
||||
>T4 : string | I4
|
||||
|
||||
type T4 = string | I4;
|
||||
>T4 : string | I4
|
||||
>I4 : I4
|
||||
|
||||
interface I4 {
|
||||
>I4 : I4
|
||||
|
||||
[x: string]: T4;
|
||||
>x : string
|
||||
>T4 : string | I4
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
var v = @decorate class C { static p = 1 };
|
||||
|
||||
//// [classExpressionWithDecorator1.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher.
|
||||
error TS1204: Cannot compile external modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher.
|
||||
tests/cases/compiler/constDeclarations_access_2.ts(2,1): error TS1202: Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from "mod"', 'import {a} from "mod"' or 'import d from "mod"' instead.
|
||||
tests/cases/compiler/constDeclarations_access_2.ts(4,1): error TS2450: Left-hand side of assignment expression cannot be a constant.
|
||||
tests/cases/compiler/constDeclarations_access_2.ts(5,1): error TS2450: Left-hand side of assignment expression cannot be a constant.
|
||||
@@ -20,7 +20,7 @@ tests/cases/compiler/constDeclarations_access_2.ts(22,3): error TS2449: The oper
|
||||
tests/cases/compiler/constDeclarations_access_2.ts(24,1): error TS2450: Left-hand side of assignment expression cannot be a constant.
|
||||
|
||||
|
||||
!!! error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher.
|
||||
!!! error TS1204: Cannot compile external modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher.
|
||||
==== tests/cases/compiler/constDeclarations_access_2.ts (19 errors) ====
|
||||
///<reference path='constDeclarations_access_1.ts'/>
|
||||
import m = require('constDeclarations_access_1');
|
||||
|
||||
@@ -10,7 +10,8 @@ export default class Decorated { }
|
||||
import Decorated from 'decorated';
|
||||
|
||||
//// [decorated.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClass1.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ export class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClass2.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -7,7 +7,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClass3.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClass4.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClass5.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClass8.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassAccessor1.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassAccessor2.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassAccessor3.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassAccessor4.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassAccessor5.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassAccessor6.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,14 +6,17 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassConstructorParameter1.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
};
|
||||
var __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };
|
||||
if (typeof __param !== "function") __param = function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
var C = (function () {
|
||||
function C(p) {
|
||||
}
|
||||
|
||||
@@ -6,14 +6,17 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassConstructorParameter4.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
};
|
||||
var __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };
|
||||
if (typeof __param !== "function") __param = function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
var C = (function () {
|
||||
function C(public, p) {
|
||||
}
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod1.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod10.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -9,7 +9,8 @@ module M {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod11.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -16,7 +16,8 @@ var __extends = this.__extends || function (d, b) {
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
};
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -7,7 +7,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod13.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod2.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod3.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod4.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod5.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod6.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod7.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethod8.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,14 +6,17 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassMethodParameter1.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
};
|
||||
var __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };
|
||||
if (typeof __param !== "function") __param = function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassProperty1.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassProperty10.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassProperty11.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassProperty2.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassProperty3.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassProperty6.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -6,7 +6,8 @@ class C {
|
||||
}
|
||||
|
||||
//// [decoratorOnClassProperty7.js]
|
||||
var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
//// [es5-umd.ts]
|
||||
|
||||
class A
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public B()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [es5-umd.js]
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
A.prototype.B = function () {
|
||||
return 42;
|
||||
};
|
||||
return A;
|
||||
})();
|
||||
//# sourceMappingURL=es5-umd.js.map
|
||||
|
||||
//// [es5-umd.d.ts]
|
||||
declare class A {
|
||||
constructor();
|
||||
B(): number;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
//// [es5-umd.js.map]
|
||||
{"version":3,"file":"es5-umd.js","sourceRoot":"","sources":["es5-umd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA;IAEIA;IAGAC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}
|
||||
@@ -0,0 +1,115 @@
|
||||
===================================================================
|
||||
JsFile: es5-umd.js
|
||||
mapUrl: es5-umd.js.map
|
||||
sourceRoot:
|
||||
sources: es5-umd.ts
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:tests/cases/compiler/es5-umd.js
|
||||
sourceFile:es5-umd.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>var A = (function () {
|
||||
1 >
|
||||
2 >^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
|
||||
---
|
||||
>>> function A() {
|
||||
1->^^^^
|
||||
2 > ^^->
|
||||
1->class A
|
||||
>{
|
||||
>
|
||||
1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A)
|
||||
---
|
||||
>>> }
|
||||
1->^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1->constructor ()
|
||||
> {
|
||||
>
|
||||
>
|
||||
2 > }
|
||||
1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
|
||||
2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor)
|
||||
---
|
||||
>>> A.prototype.B = function () {
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^
|
||||
3 > ^^^
|
||||
1->
|
||||
>
|
||||
> public
|
||||
2 > B
|
||||
3 >
|
||||
1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A)
|
||||
2 >Emitted(4, 18) Source(9, 13) + SourceIndex(0) name (A)
|
||||
3 >Emitted(4, 21) Source(9, 5) + SourceIndex(0) name (A)
|
||||
---
|
||||
>>> return 42;
|
||||
1 >^^^^^^^^
|
||||
2 > ^^^^^^
|
||||
3 > ^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
1 >public B()
|
||||
> {
|
||||
>
|
||||
2 > return
|
||||
3 >
|
||||
4 > 42
|
||||
5 > ;
|
||||
1 >Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B)
|
||||
2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B)
|
||||
3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B)
|
||||
4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B)
|
||||
5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B)
|
||||
---
|
||||
>>> };
|
||||
1 >^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B)
|
||||
2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B)
|
||||
---
|
||||
>>> return A;
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^
|
||||
1->
|
||||
>
|
||||
2 > }
|
||||
1->Emitted(7, 5) Source(13, 1) + SourceIndex(0) name (A)
|
||||
2 >Emitted(7, 13) Source(13, 2) + SourceIndex(0) name (A)
|
||||
---
|
||||
>>>})();
|
||||
1 >
|
||||
2 >^
|
||||
3 >
|
||||
4 > ^^^^
|
||||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >}
|
||||
3 >
|
||||
4 > class A
|
||||
> {
|
||||
> constructor ()
|
||||
> {
|
||||
>
|
||||
> }
|
||||
>
|
||||
> public B()
|
||||
> {
|
||||
> return 42;
|
||||
> }
|
||||
> }
|
||||
1 >Emitted(8, 1) Source(13, 1) + SourceIndex(0) name (A)
|
||||
2 >Emitted(8, 2) Source(13, 2) + SourceIndex(0) name (A)
|
||||
3 >Emitted(8, 2) Source(2, 1) + SourceIndex(0)
|
||||
4 >Emitted(8, 6) Source(13, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=es5-umd.js.map
|
||||
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/compiler/es5-umd.ts ===
|
||||
|
||||
class A
|
||||
>A : Symbol(A, Decl(es5-umd.ts, 0, 0))
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public B()
|
||||
>B : Symbol(B, Decl(es5-umd.ts, 6, 5))
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
=== tests/cases/compiler/es5-umd.ts ===
|
||||
|
||||
class A
|
||||
>A : A
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public B()
|
||||
>B : () => number
|
||||
{
|
||||
return 42;
|
||||
>42 : number
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
//// [es5-umd2.ts]
|
||||
|
||||
export class A
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public B()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [es5-umd2.js]
|
||||
(function (deps, factory) {
|
||||
if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
var v = factory(require, exports); if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === 'function' && define.amd) {
|
||||
define(deps, factory);
|
||||
}
|
||||
})(["require", "exports"], function (require, exports) {
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
A.prototype.B = function () {
|
||||
return 42;
|
||||
};
|
||||
return A;
|
||||
})();
|
||||
exports.A = A;
|
||||
});
|
||||
//# sourceMappingURL=es5-umd2.js.map
|
||||
|
||||
//// [es5-umd2.d.ts]
|
||||
export declare class A {
|
||||
constructor();
|
||||
B(): number;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
//// [es5-umd2.js.map]
|
||||
{"version":3,"file":"es5-umd2.js","sourceRoot":"","sources":["es5-umd2.ts"],"names":["A","A.constructor","A.B"],"mappings":";;;;;;;;IACA;QAEIA;QAGAC,CAACA;QAEMD,aAACA,GAARA;YAEIE,MAAMA,CAACA,EAAEA,CAACA;QACdA,CAACA;QACLF,QAACA;IAADA,CAACA,AAXD,IAWC;IAXY,SAAC,IAWb,CAAA"}
|
||||
@@ -0,0 +1,149 @@
|
||||
===================================================================
|
||||
JsFile: es5-umd2.js
|
||||
mapUrl: es5-umd2.js.map
|
||||
sourceRoot:
|
||||
sources: es5-umd2.ts
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:tests/cases/compiler/es5-umd2.js
|
||||
sourceFile:es5-umd2.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>(function (deps, factory) {
|
||||
>>> if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
>>> var v = factory(require, exports); if (v !== undefined) module.exports = v;
|
||||
>>> }
|
||||
>>> else if (typeof define === 'function' && define.amd) {
|
||||
>>> define(deps, factory);
|
||||
>>> }
|
||||
>>>})(["require", "exports"], function (require, exports) {
|
||||
>>> var A = (function () {
|
||||
1 >^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
1 >Emitted(9, 5) Source(2, 1) + SourceIndex(0)
|
||||
---
|
||||
>>> function A() {
|
||||
1->^^^^^^^^
|
||||
2 > ^^->
|
||||
1->export class A
|
||||
>{
|
||||
>
|
||||
1->Emitted(10, 9) Source(4, 5) + SourceIndex(0) name (A)
|
||||
---
|
||||
>>> }
|
||||
1->^^^^^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1->constructor ()
|
||||
> {
|
||||
>
|
||||
>
|
||||
2 > }
|
||||
1->Emitted(11, 9) Source(7, 5) + SourceIndex(0) name (A.constructor)
|
||||
2 >Emitted(11, 10) Source(7, 6) + SourceIndex(0) name (A.constructor)
|
||||
---
|
||||
>>> A.prototype.B = function () {
|
||||
1->^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^
|
||||
3 > ^^^
|
||||
1->
|
||||
>
|
||||
> public
|
||||
2 > B
|
||||
3 >
|
||||
1->Emitted(12, 9) Source(9, 12) + SourceIndex(0) name (A)
|
||||
2 >Emitted(12, 22) Source(9, 13) + SourceIndex(0) name (A)
|
||||
3 >Emitted(12, 25) Source(9, 5) + SourceIndex(0) name (A)
|
||||
---
|
||||
>>> return 42;
|
||||
1 >^^^^^^^^^^^^
|
||||
2 > ^^^^^^
|
||||
3 > ^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
1 >public B()
|
||||
> {
|
||||
>
|
||||
2 > return
|
||||
3 >
|
||||
4 > 42
|
||||
5 > ;
|
||||
1 >Emitted(13, 13) Source(11, 9) + SourceIndex(0) name (A.B)
|
||||
2 >Emitted(13, 19) Source(11, 15) + SourceIndex(0) name (A.B)
|
||||
3 >Emitted(13, 20) Source(11, 16) + SourceIndex(0) name (A.B)
|
||||
4 >Emitted(13, 22) Source(11, 18) + SourceIndex(0) name (A.B)
|
||||
5 >Emitted(13, 23) Source(11, 19) + SourceIndex(0) name (A.B)
|
||||
---
|
||||
>>> };
|
||||
1 >^^^^^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(14, 9) Source(12, 5) + SourceIndex(0) name (A.B)
|
||||
2 >Emitted(14, 10) Source(12, 6) + SourceIndex(0) name (A.B)
|
||||
---
|
||||
>>> return A;
|
||||
1->^^^^^^^^
|
||||
2 > ^^^^^^^^
|
||||
1->
|
||||
>
|
||||
2 > }
|
||||
1->Emitted(15, 9) Source(13, 1) + SourceIndex(0) name (A)
|
||||
2 >Emitted(15, 17) Source(13, 2) + SourceIndex(0) name (A)
|
||||
---
|
||||
>>> })();
|
||||
1 >^^^^
|
||||
2 > ^
|
||||
3 >
|
||||
4 > ^^^^
|
||||
5 > ^^^^^^^^^^->
|
||||
1 >
|
||||
2 > }
|
||||
3 >
|
||||
4 > export class A
|
||||
> {
|
||||
> constructor ()
|
||||
> {
|
||||
>
|
||||
> }
|
||||
>
|
||||
> public B()
|
||||
> {
|
||||
> return 42;
|
||||
> }
|
||||
> }
|
||||
1 >Emitted(16, 5) Source(13, 1) + SourceIndex(0) name (A)
|
||||
2 >Emitted(16, 6) Source(13, 2) + SourceIndex(0) name (A)
|
||||
3 >Emitted(16, 6) Source(2, 1) + SourceIndex(0)
|
||||
4 >Emitted(16, 10) Source(13, 2) + SourceIndex(0)
|
||||
---
|
||||
>>> exports.A = A;
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^
|
||||
3 > ^^^^
|
||||
4 > ^
|
||||
1->
|
||||
2 > A
|
||||
3 >
|
||||
> {
|
||||
> constructor ()
|
||||
> {
|
||||
>
|
||||
> }
|
||||
>
|
||||
> public B()
|
||||
> {
|
||||
> return 42;
|
||||
> }
|
||||
> }
|
||||
4 >
|
||||
1->Emitted(17, 5) Source(2, 14) + SourceIndex(0)
|
||||
2 >Emitted(17, 14) Source(2, 15) + SourceIndex(0)
|
||||
3 >Emitted(17, 18) Source(13, 2) + SourceIndex(0)
|
||||
4 >Emitted(17, 19) Source(13, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>});
|
||||
>>>//# sourceMappingURL=es5-umd2.js.map
|
||||
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/compiler/es5-umd2.ts ===
|
||||
|
||||
export class A
|
||||
>A : Symbol(A, Decl(es5-umd2.ts, 0, 0))
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public B()
|
||||
>B : Symbol(B, Decl(es5-umd2.ts, 6, 5))
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
=== tests/cases/compiler/es5-umd2.ts ===
|
||||
|
||||
export class A
|
||||
>A : A
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public B()
|
||||
>B : () => number
|
||||
{
|
||||
return 42;
|
||||
>42 : number
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
//// [es5-umd3.ts]
|
||||
|
||||
export default class A
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public B()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [es5-umd3.js]
|
||||
(function (deps, factory) {
|
||||
if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
var v = factory(require, exports); if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === 'function' && define.amd) {
|
||||
define(deps, factory);
|
||||
}
|
||||
})(["require", "exports"], function (require, exports) {
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
A.prototype.B = function () {
|
||||
return 42;
|
||||
};
|
||||
return A;
|
||||
})();
|
||||
exports.default = A;
|
||||
});
|
||||
//# sourceMappingURL=es5-umd3.js.map
|
||||
|
||||
//// [es5-umd3.d.ts]
|
||||
export default class A {
|
||||
constructor();
|
||||
B(): number;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
//// [es5-umd3.js.map]
|
||||
{"version":3,"file":"es5-umd3.js","sourceRoot":"","sources":["es5-umd3.ts"],"names":["A","A.constructor","A.B"],"mappings":";;;;;;;;IACA;QAEIA;QAGAC,CAACA;QAEMD,aAACA,GAARA;YAEIE,MAAMA,CAACA,EAAEA,CAACA;QACdA,CAACA;QACLF,QAACA;IAADA,CAACA,AAXD,IAWC;IAXD,mBAWC,CAAA"}
|
||||
@@ -0,0 +1,146 @@
|
||||
===================================================================
|
||||
JsFile: es5-umd3.js
|
||||
mapUrl: es5-umd3.js.map
|
||||
sourceRoot:
|
||||
sources: es5-umd3.ts
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:tests/cases/compiler/es5-umd3.js
|
||||
sourceFile:es5-umd3.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>(function (deps, factory) {
|
||||
>>> if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
>>> var v = factory(require, exports); if (v !== undefined) module.exports = v;
|
||||
>>> }
|
||||
>>> else if (typeof define === 'function' && define.amd) {
|
||||
>>> define(deps, factory);
|
||||
>>> }
|
||||
>>>})(["require", "exports"], function (require, exports) {
|
||||
>>> var A = (function () {
|
||||
1 >^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
1 >Emitted(9, 5) Source(2, 1) + SourceIndex(0)
|
||||
---
|
||||
>>> function A() {
|
||||
1->^^^^^^^^
|
||||
2 > ^^->
|
||||
1->export default class A
|
||||
>{
|
||||
>
|
||||
1->Emitted(10, 9) Source(4, 5) + SourceIndex(0) name (A)
|
||||
---
|
||||
>>> }
|
||||
1->^^^^^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1->constructor ()
|
||||
> {
|
||||
>
|
||||
>
|
||||
2 > }
|
||||
1->Emitted(11, 9) Source(7, 5) + SourceIndex(0) name (A.constructor)
|
||||
2 >Emitted(11, 10) Source(7, 6) + SourceIndex(0) name (A.constructor)
|
||||
---
|
||||
>>> A.prototype.B = function () {
|
||||
1->^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^
|
||||
3 > ^^^
|
||||
1->
|
||||
>
|
||||
> public
|
||||
2 > B
|
||||
3 >
|
||||
1->Emitted(12, 9) Source(9, 12) + SourceIndex(0) name (A)
|
||||
2 >Emitted(12, 22) Source(9, 13) + SourceIndex(0) name (A)
|
||||
3 >Emitted(12, 25) Source(9, 5) + SourceIndex(0) name (A)
|
||||
---
|
||||
>>> return 42;
|
||||
1 >^^^^^^^^^^^^
|
||||
2 > ^^^^^^
|
||||
3 > ^
|
||||
4 > ^^
|
||||
5 > ^
|
||||
1 >public B()
|
||||
> {
|
||||
>
|
||||
2 > return
|
||||
3 >
|
||||
4 > 42
|
||||
5 > ;
|
||||
1 >Emitted(13, 13) Source(11, 9) + SourceIndex(0) name (A.B)
|
||||
2 >Emitted(13, 19) Source(11, 15) + SourceIndex(0) name (A.B)
|
||||
3 >Emitted(13, 20) Source(11, 16) + SourceIndex(0) name (A.B)
|
||||
4 >Emitted(13, 22) Source(11, 18) + SourceIndex(0) name (A.B)
|
||||
5 >Emitted(13, 23) Source(11, 19) + SourceIndex(0) name (A.B)
|
||||
---
|
||||
>>> };
|
||||
1 >^^^^^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(14, 9) Source(12, 5) + SourceIndex(0) name (A.B)
|
||||
2 >Emitted(14, 10) Source(12, 6) + SourceIndex(0) name (A.B)
|
||||
---
|
||||
>>> return A;
|
||||
1->^^^^^^^^
|
||||
2 > ^^^^^^^^
|
||||
1->
|
||||
>
|
||||
2 > }
|
||||
1->Emitted(15, 9) Source(13, 1) + SourceIndex(0) name (A)
|
||||
2 >Emitted(15, 17) Source(13, 2) + SourceIndex(0) name (A)
|
||||
---
|
||||
>>> })();
|
||||
1 >^^^^
|
||||
2 > ^
|
||||
3 >
|
||||
4 > ^^^^
|
||||
5 > ^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 > }
|
||||
3 >
|
||||
4 > export default class A
|
||||
> {
|
||||
> constructor ()
|
||||
> {
|
||||
>
|
||||
> }
|
||||
>
|
||||
> public B()
|
||||
> {
|
||||
> return 42;
|
||||
> }
|
||||
> }
|
||||
1 >Emitted(16, 5) Source(13, 1) + SourceIndex(0) name (A)
|
||||
2 >Emitted(16, 6) Source(13, 2) + SourceIndex(0) name (A)
|
||||
3 >Emitted(16, 6) Source(2, 1) + SourceIndex(0)
|
||||
4 >Emitted(16, 10) Source(13, 2) + SourceIndex(0)
|
||||
---
|
||||
>>> exports.default = A;
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^
|
||||
1->
|
||||
2 > export default class A
|
||||
> {
|
||||
> constructor ()
|
||||
> {
|
||||
>
|
||||
> }
|
||||
>
|
||||
> public B()
|
||||
> {
|
||||
> return 42;
|
||||
> }
|
||||
> }
|
||||
3 >
|
||||
1->Emitted(17, 5) Source(2, 1) + SourceIndex(0)
|
||||
2 >Emitted(17, 24) Source(13, 2) + SourceIndex(0)
|
||||
3 >Emitted(17, 25) Source(13, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>});
|
||||
>>>//# sourceMappingURL=es5-umd3.js.map
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user