diff --git a/bin/lib.d.ts b/bin/lib.d.ts
index 82a6fa8345c..5eaa933d164 100644
--- a/bin/lib.d.ts
+++ b/bin/lib.d.ts
@@ -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 {
diff --git a/bin/lib.dom.d.ts b/bin/lib.dom.d.ts
index d66afb9b27f..2c970a1cf52 100644
--- a/bin/lib.dom.d.ts
+++ b/bin/lib.dom.d.ts
@@ -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 {
diff --git a/bin/lib.es6.d.ts b/bin/lib.es6.d.ts
index e2a76a04ae2..297cac973e3 100644
--- a/bin/lib.es6.d.ts
+++ b/bin/lib.es6.d.ts
@@ -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 {
diff --git a/bin/tsc.js b/bin/tsc.js
index 3323c446649..49960ff3e50 100644
--- a/bin/tsc.js
+++ b/bin/tsc.js
@@ -1399,6 +1399,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." },
@@ -11553,7 +11555,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);
@@ -20156,8 +20158,8 @@ 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 decorateHelper = "\nvar __decorate = this.__decorate || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
+ var metadataHelper = "\nvar __metadata = this.__metadata || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};";
var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };";
var compilerOptions = host.getCompilerOptions();
var languageVersion = compilerOptions.target || 0;
@@ -24441,7 +24443,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 +24452,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 +24665,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) {
@@ -24710,34 +24759,13 @@ var ts;
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;
}
}
@@ -24864,6 +24892,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"
diff --git a/bin/tsserver.js b/bin/tsserver.js
index b54ac96e5d0..782f4471799 100644
--- a/bin/tsserver.js
+++ b/bin/tsserver.js
@@ -1399,6 +1399,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." },
@@ -2796,6 +2798,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"
@@ -11896,7 +11905,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);
@@ -20499,8 +20508,8 @@ 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 decorateHelper = "\nvar __decorate = this.__decorate || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
+ var metadataHelper = "\nvar __metadata = this.__metadata || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};";
var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };";
var compilerOptions = host.getCompilerOptions();
var languageVersion = compilerOptions.target || 0;
@@ -24784,7 +24793,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 +24802,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 +25015,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) {
@@ -25053,34 +25109,13 @@ var ts;
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;
}
}
@@ -34835,6 +34870,9 @@ var ts;
if (lineText.charAt(i) == " ") {
indentPosition--;
}
+ else if (lineText.charAt(i) == "\t") {
+ indentPosition -= editorOptions.IndentSize;
+ }
else {
break;
}
diff --git a/bin/typescript.d.ts b/bin/typescript.d.ts
index 2ce77b9fb70..f86da199763 100644
--- a/bin/typescript.d.ts
+++ b/bin/typescript.d.ts
@@ -1095,6 +1095,7 @@ declare module "typescript" {
preserveConstEnums?: boolean;
project?: string;
removeComments?: boolean;
+ rootDir?: string;
sourceMap?: boolean;
sourceRoot?: string;
suppressImplicitAnyIndexErrors?: boolean;
diff --git a/bin/typescript.js b/bin/typescript.js
index 8b29d8d0252..e012dbafb5b 100644
--- a/bin/typescript.js
+++ b/bin/typescript.js
@@ -2133,6 +2133,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." },
@@ -14105,7 +14107,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 */);
@@ -24025,9 +24027,9 @@ 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 = "\nvar __decorate = this.__decorate || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
// emit output for the __metadata helper function
- var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };";
+ var metadataHelper = "\nvar __metadata = this.__metadata || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};";
// emit output for the __param helper function
var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };";
var compilerOptions = host.getCompilerOptions();
@@ -28855,7 +28857,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 +28866,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 +29097,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) {
@@ -29147,38 +29200,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
@@ -29309,6 +29339,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"
diff --git a/bin/typescriptServices.d.ts b/bin/typescriptServices.d.ts
index e6d06765c27..cd8ee05add4 100644
--- a/bin/typescriptServices.d.ts
+++ b/bin/typescriptServices.d.ts
@@ -1095,6 +1095,7 @@ declare module ts {
preserveConstEnums?: boolean;
project?: string;
removeComments?: boolean;
+ rootDir?: string;
sourceMap?: boolean;
sourceRoot?: string;
suppressImplicitAnyIndexErrors?: boolean;
diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js
index 8b29d8d0252..e012dbafb5b 100644
--- a/bin/typescriptServices.js
+++ b/bin/typescriptServices.js
@@ -2133,6 +2133,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." },
@@ -14105,7 +14107,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 */);
@@ -24025,9 +24027,9 @@ 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 = "\nvar __decorate = this.__decorate || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};";
// emit output for the __metadata helper function
- var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };";
+ var metadataHelper = "\nvar __metadata = this.__metadata || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};";
// emit output for the __param helper function
var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };";
var compilerOptions = host.getCompilerOptions();
@@ -28855,7 +28857,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 +28866,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 +29097,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) {
@@ -29147,38 +29200,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
@@ -29309,6 +29339,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"
diff --git a/doc/logo.svg b/doc/logo.svg
new file mode 100644
index 00000000000..fc7e0fadd66
--- /dev/null
+++ b/doc/logo.svg
@@ -0,0 +1,15 @@
+
+
diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts
index 9d6d9fab35b..170f3d3c830 100644
--- a/src/compiler/binder.ts
+++ b/src/compiler/binder.ts
@@ -239,11 +239,7 @@ module ts {
if (symbolKind & SymbolFlags.IsContainer) {
container = node;
- if (lastContainer) {
- lastContainer.nextContainer = container;
- }
-
- lastContainer = container;
+ addToContainerChain(container);
}
if (isBlockScopeContainer) {
@@ -262,6 +258,14 @@ module ts {
blockScopeContainer = savedBlockScopeContainer;
}
+ function addToContainerChain(node: Node) {
+ if (lastContainer) {
+ lastContainer.nextContainer = node;
+ }
+
+ lastContainer = node;
+ }
+
function bindDeclaration(node: Declaration, symbolKind: SymbolFlags, symbolExcludes: SymbolFlags, isBlockScopeContainer: boolean) {
switch (container.kind) {
case SyntaxKind.ModuleDeclaration:
@@ -403,6 +407,7 @@ module ts {
default:
if (!blockScopeContainer.locals) {
blockScopeContainer.locals = {};
+ addToContainerChain(blockScopeContainer);
}
declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes);
}
diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts
index fc1293d6040..3645695ca76 100644
--- a/src/compiler/commandLineParser.ts
+++ b/src/compiler/commandLineParser.ts
@@ -110,6 +110,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",
diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts
index f3e9c325da6..90f0ed0a0df 100644
--- a/src/compiler/diagnosticInformationMap.generated.ts
+++ b/src/compiler/diagnosticInformationMap.generated.ts
@@ -496,6 +496,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." },
diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json
index 61ce23c316b..48ef245c766 100644
--- a/src/compiler/diagnosticMessages.json
+++ b/src/compiler/diagnosticMessages.json
@@ -1972,6 +1972,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",
diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts
index 226c682d2d7..f4aa0fe1022 100644
--- a/src/compiler/emitter.ts
+++ b/src/compiler/emitter.ts
@@ -34,7 +34,8 @@ var __extends = this.__extends || function (d, b) {
// emit output for the __decorate helper function
const decorateHelper = `
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
@@ -44,7 +45,9 @@ var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.deco
// emit output for the __metadata helper function
const metadataHelper = `
-var __metadata = this.__metadata || (typeof Reflect === "object" && Reflect.metadata) || function () { };`;
+var __metadata = this.__metadata || function (k, v) {
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
+};`;
// emit output for the __param helper function
const paramHelper = `
diff --git a/src/compiler/program.ts b/src/compiler/program.ts
index a27f943dc7e..d49e01bd45d 100644
--- a/src/compiler/program.ts
+++ b/src/compiler/program.ts
@@ -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) {
@@ -517,41 +577,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
diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts
index c2b693d6772..df6c20a8107 100644
--- a/src/compiler/scanner.ts
+++ b/src/compiler/scanner.ts
@@ -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
// \u000D Carriage Return
diff --git a/src/compiler/types.ts b/src/compiler/types.ts
index 7decd8bd215..9c1325598f7 100644
--- a/src/compiler/types.ts
+++ b/src/compiler/types.ts
@@ -1658,6 +1658,7 @@ module ts {
preserveConstEnums?: boolean;
project?: string;
removeComments?: boolean;
+ rootDir?: string;
sourceMap?: boolean;
sourceRoot?: string;
suppressImplicitAnyIndexErrors?: boolean;
diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts
index 42a0cabe48c..3dbd67190e9 100644
--- a/src/harness/compilerRunner.ts
+++ b/src/harness/compilerRunner.ts
@@ -97,7 +97,7 @@ class CompilerBaselineRunner extends RunnerBase {
program = _program;
}, function (settings) {
harnessCompiler.setCompilerSettings(tcSettings);
- });
+ });
});
beforeEach(() => {
@@ -252,7 +252,7 @@ class CompilerBaselineRunner extends RunnerBase {
}
});
- it('Correct type baselines for ' + fileName, () => {
+ it('Correct type/symbol baselines for ' + fileName, () => {
if (fileName.indexOf("APISample") >= 0) {
return;
}
@@ -289,8 +289,26 @@ class CompilerBaselineRunner extends RunnerBase {
// Produce baselines. The first gives the types for all expressions.
// The second gives symbols for all identifiers.
- checkBaseLines(/*isSymbolBaseLine:*/ false);
- checkBaseLines(/*isSymbolBaseLine:*/ true);
+ var e1: Error, e2: Error;
+ try {
+ checkBaseLines(/*isSymbolBaseLine:*/ false);
+ }
+ catch (e) {
+ e1 = e;
+ }
+
+ try {
+ checkBaseLines(/*isSymbolBaseLine:*/ true);
+ }
+ catch (e) {
+ e2 = e;
+ }
+
+ if (e1 || e2) {
+ throw e1 || e2;
+ }
+
+ return;
function checkBaseLines(isSymbolBaseLine: boolean) {
let fullBaseLine = generateBaseLine(fullResults, isSymbolBaseLine);
diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts
index 3291128a7a5..6823bfafac2 100644
--- a/src/harness/projectsRunner.ts
+++ b/src/harness/projectsRunner.ts
@@ -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
};
}
@@ -344,6 +346,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)
};
diff --git a/tests/baselines/reference/classExpressionWithDecorator1.js b/tests/baselines/reference/classExpressionWithDecorator1.js
index 3e255398904..964a92bb277 100644
--- a/tests/baselines/reference/classExpressionWithDecorator1.js
+++ b/tests/baselines/reference/classExpressionWithDecorator1.js
@@ -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) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratedClassFromExternalModule.js b/tests/baselines/reference/decoratedClassFromExternalModule.js
index a58eb01a426..62c03937a50 100644
--- a/tests/baselines/reference/decoratedClassFromExternalModule.js
+++ b/tests/baselines/reference/decoratedClassFromExternalModule.js
@@ -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) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClass1.js b/tests/baselines/reference/decoratorOnClass1.js
index cd5c51e7a93..679561e2b2f 100644
--- a/tests/baselines/reference/decoratorOnClass1.js
+++ b/tests/baselines/reference/decoratorOnClass1.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClass1.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClass2.js b/tests/baselines/reference/decoratorOnClass2.js
index fbd9a106ddf..43a67745ae8 100644
--- a/tests/baselines/reference/decoratorOnClass2.js
+++ b/tests/baselines/reference/decoratorOnClass2.js
@@ -6,7 +6,8 @@ export class C {
}
//// [decoratorOnClass2.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClass3.js b/tests/baselines/reference/decoratorOnClass3.js
index 21536028091..05e01f7c382 100644
--- a/tests/baselines/reference/decoratorOnClass3.js
+++ b/tests/baselines/reference/decoratorOnClass3.js
@@ -7,7 +7,8 @@ class C {
}
//// [decoratorOnClass3.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClass4.js b/tests/baselines/reference/decoratorOnClass4.js
index 5099d16b5b4..747a68a790e 100644
--- a/tests/baselines/reference/decoratorOnClass4.js
+++ b/tests/baselines/reference/decoratorOnClass4.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClass4.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClass5.js b/tests/baselines/reference/decoratorOnClass5.js
index 0555f618e7e..5c7799937d6 100644
--- a/tests/baselines/reference/decoratorOnClass5.js
+++ b/tests/baselines/reference/decoratorOnClass5.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClass5.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClass8.js b/tests/baselines/reference/decoratorOnClass8.js
index fad73c0c8fc..86c52b50b44 100644
--- a/tests/baselines/reference/decoratorOnClass8.js
+++ b/tests/baselines/reference/decoratorOnClass8.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClass8.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassAccessor1.js b/tests/baselines/reference/decoratorOnClassAccessor1.js
index 68fa7ccec0a..5143f7daceb 100644
--- a/tests/baselines/reference/decoratorOnClassAccessor1.js
+++ b/tests/baselines/reference/decoratorOnClassAccessor1.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassAccessor1.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassAccessor2.js b/tests/baselines/reference/decoratorOnClassAccessor2.js
index 17d3e2e422d..fc5da177eaa 100644
--- a/tests/baselines/reference/decoratorOnClassAccessor2.js
+++ b/tests/baselines/reference/decoratorOnClassAccessor2.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassAccessor2.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassAccessor3.js b/tests/baselines/reference/decoratorOnClassAccessor3.js
index 23e689f3114..08032785683 100644
--- a/tests/baselines/reference/decoratorOnClassAccessor3.js
+++ b/tests/baselines/reference/decoratorOnClassAccessor3.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassAccessor3.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassAccessor4.js b/tests/baselines/reference/decoratorOnClassAccessor4.js
index 77bcb568fe1..f43ad96771b 100644
--- a/tests/baselines/reference/decoratorOnClassAccessor4.js
+++ b/tests/baselines/reference/decoratorOnClassAccessor4.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassAccessor4.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassAccessor5.js b/tests/baselines/reference/decoratorOnClassAccessor5.js
index 37fc33abefd..781585eb4d4 100644
--- a/tests/baselines/reference/decoratorOnClassAccessor5.js
+++ b/tests/baselines/reference/decoratorOnClassAccessor5.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassAccessor5.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassAccessor6.js b/tests/baselines/reference/decoratorOnClassAccessor6.js
index 465e13ebb1d..74feb09088b 100644
--- a/tests/baselines/reference/decoratorOnClassAccessor6.js
+++ b/tests/baselines/reference/decoratorOnClassAccessor6.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassAccessor6.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter1.js b/tests/baselines/reference/decoratorOnClassConstructorParameter1.js
index a1748a725ba..efd290b0668 100644
--- a/tests/baselines/reference/decoratorOnClassConstructorParameter1.js
+++ b/tests/baselines/reference/decoratorOnClassConstructorParameter1.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassConstructorParameter1.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter4.js b/tests/baselines/reference/decoratorOnClassConstructorParameter4.js
index 9d2b4a690ab..c1869d6050b 100644
--- a/tests/baselines/reference/decoratorOnClassConstructorParameter4.js
+++ b/tests/baselines/reference/decoratorOnClassConstructorParameter4.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassConstructorParameter4.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassMethod1.js b/tests/baselines/reference/decoratorOnClassMethod1.js
index 23be1094305..b13928ab75e 100644
--- a/tests/baselines/reference/decoratorOnClassMethod1.js
+++ b/tests/baselines/reference/decoratorOnClassMethod1.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassMethod1.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassMethod10.js b/tests/baselines/reference/decoratorOnClassMethod10.js
index f87e3137777..5faf5f5adfd 100644
--- a/tests/baselines/reference/decoratorOnClassMethod10.js
+++ b/tests/baselines/reference/decoratorOnClassMethod10.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassMethod10.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassMethod11.js b/tests/baselines/reference/decoratorOnClassMethod11.js
index f8276de2fe3..2250eef2d88 100644
--- a/tests/baselines/reference/decoratorOnClassMethod11.js
+++ b/tests/baselines/reference/decoratorOnClassMethod11.js
@@ -9,7 +9,8 @@ module M {
}
//// [decoratorOnClassMethod11.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassMethod12.js b/tests/baselines/reference/decoratorOnClassMethod12.js
index 7f23947929c..36874663abd 100644
--- a/tests/baselines/reference/decoratorOnClassMethod12.js
+++ b/tests/baselines/reference/decoratorOnClassMethod12.js
@@ -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) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassMethod13.js b/tests/baselines/reference/decoratorOnClassMethod13.js
index 4321bbb0156..36dfcf750c0 100644
--- a/tests/baselines/reference/decoratorOnClassMethod13.js
+++ b/tests/baselines/reference/decoratorOnClassMethod13.js
@@ -7,7 +7,8 @@ class C {
}
//// [decoratorOnClassMethod13.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassMethod2.js b/tests/baselines/reference/decoratorOnClassMethod2.js
index 33a22f419d4..7089c4701e4 100644
--- a/tests/baselines/reference/decoratorOnClassMethod2.js
+++ b/tests/baselines/reference/decoratorOnClassMethod2.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassMethod2.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassMethod3.js b/tests/baselines/reference/decoratorOnClassMethod3.js
index f93b7d7a6b2..6c09a14c1a3 100644
--- a/tests/baselines/reference/decoratorOnClassMethod3.js
+++ b/tests/baselines/reference/decoratorOnClassMethod3.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassMethod3.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassMethod4.js b/tests/baselines/reference/decoratorOnClassMethod4.js
index 038432f2cf0..1e5f03a0ad4 100644
--- a/tests/baselines/reference/decoratorOnClassMethod4.js
+++ b/tests/baselines/reference/decoratorOnClassMethod4.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassMethod4.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassMethod5.js b/tests/baselines/reference/decoratorOnClassMethod5.js
index 460c11f145b..fd6520f99da 100644
--- a/tests/baselines/reference/decoratorOnClassMethod5.js
+++ b/tests/baselines/reference/decoratorOnClassMethod5.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassMethod5.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassMethod6.js b/tests/baselines/reference/decoratorOnClassMethod6.js
index 9f120599183..b99cacd6ca0 100644
--- a/tests/baselines/reference/decoratorOnClassMethod6.js
+++ b/tests/baselines/reference/decoratorOnClassMethod6.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassMethod6.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassMethod7.js b/tests/baselines/reference/decoratorOnClassMethod7.js
index 6ab01e68bba..e86480e9895 100644
--- a/tests/baselines/reference/decoratorOnClassMethod7.js
+++ b/tests/baselines/reference/decoratorOnClassMethod7.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassMethod7.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassMethod8.js b/tests/baselines/reference/decoratorOnClassMethod8.js
index 3e88f8c2793..c9048ce30f3 100644
--- a/tests/baselines/reference/decoratorOnClassMethod8.js
+++ b/tests/baselines/reference/decoratorOnClassMethod8.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassMethod8.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassMethodParameter1.js b/tests/baselines/reference/decoratorOnClassMethodParameter1.js
index d228ed9302b..3d62dfe3d96 100644
--- a/tests/baselines/reference/decoratorOnClassMethodParameter1.js
+++ b/tests/baselines/reference/decoratorOnClassMethodParameter1.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassMethodParameter1.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassProperty1.js b/tests/baselines/reference/decoratorOnClassProperty1.js
index aa38252b995..45307cfc57e 100644
--- a/tests/baselines/reference/decoratorOnClassProperty1.js
+++ b/tests/baselines/reference/decoratorOnClassProperty1.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassProperty1.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassProperty10.js b/tests/baselines/reference/decoratorOnClassProperty10.js
index bccbc0bb737..1479d2033c9 100644
--- a/tests/baselines/reference/decoratorOnClassProperty10.js
+++ b/tests/baselines/reference/decoratorOnClassProperty10.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassProperty10.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassProperty11.js b/tests/baselines/reference/decoratorOnClassProperty11.js
index f31e40d3c40..e86c112f436 100644
--- a/tests/baselines/reference/decoratorOnClassProperty11.js
+++ b/tests/baselines/reference/decoratorOnClassProperty11.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassProperty11.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassProperty2.js b/tests/baselines/reference/decoratorOnClassProperty2.js
index 477320b40fa..fed6e57116e 100644
--- a/tests/baselines/reference/decoratorOnClassProperty2.js
+++ b/tests/baselines/reference/decoratorOnClassProperty2.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassProperty2.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassProperty3.js b/tests/baselines/reference/decoratorOnClassProperty3.js
index 05476c66e7d..0b81416b3fd 100644
--- a/tests/baselines/reference/decoratorOnClassProperty3.js
+++ b/tests/baselines/reference/decoratorOnClassProperty3.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassProperty3.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassProperty6.js b/tests/baselines/reference/decoratorOnClassProperty6.js
index 46e2d5fc069..740ad346aa3 100644
--- a/tests/baselines/reference/decoratorOnClassProperty6.js
+++ b/tests/baselines/reference/decoratorOnClassProperty6.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassProperty6.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/decoratorOnClassProperty7.js b/tests/baselines/reference/decoratorOnClassProperty7.js
index 14ca0612cb1..1b34d5dac07 100644
--- a/tests/baselines/reference/decoratorOnClassProperty7.js
+++ b/tests/baselines/reference/decoratorOnClassProperty7.js
@@ -6,7 +6,8 @@ class C {
}
//// [decoratorOnClassProperty7.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.js b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.js
new file mode 100644
index 00000000000..6a7041a6733
--- /dev/null
+++ b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.js
@@ -0,0 +1,25 @@
+//// [nameCollisionWithBlockScopedVariable1.ts]
+module M {
+ export class C { }
+}
+module M {
+ {
+ let M = 0;
+ new C();
+ }
+}
+
+//// [nameCollisionWithBlockScopedVariable1.js]
+var M;
+(function (M) {
+ class C {
+ }
+ M.C = C;
+})(M || (M = {}));
+var M;
+(function (M_1) {
+ {
+ let M = 0;
+ new M_1.C();
+ }
+})(M || (M = {}));
diff --git a/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.symbols b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.symbols
new file mode 100644
index 00000000000..9c0d01bd8e9
--- /dev/null
+++ b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.symbols
@@ -0,0 +1,17 @@
+=== tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts ===
+module M {
+>M : Symbol(M, Decl(nameCollisionWithBlockScopedVariable1.ts, 0, 0), Decl(nameCollisionWithBlockScopedVariable1.ts, 2, 1))
+
+ export class C { }
+>C : Symbol(C, Decl(nameCollisionWithBlockScopedVariable1.ts, 0, 10))
+}
+module M {
+>M : Symbol(M, Decl(nameCollisionWithBlockScopedVariable1.ts, 0, 0), Decl(nameCollisionWithBlockScopedVariable1.ts, 2, 1))
+ {
+ let M = 0;
+>M : Symbol(M, Decl(nameCollisionWithBlockScopedVariable1.ts, 5, 11))
+
+ new C();
+>C : Symbol(C, Decl(nameCollisionWithBlockScopedVariable1.ts, 0, 10))
+ }
+}
diff --git a/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types
new file mode 100644
index 00000000000..7a3c07af187
--- /dev/null
+++ b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types
@@ -0,0 +1,19 @@
+=== tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts ===
+module M {
+>M : typeof M
+
+ export class C { }
+>C : C
+}
+module M {
+>M : typeof M
+ {
+ let M = 0;
+>M : number
+>0 : number
+
+ new C();
+>new C() : C
+>C : typeof C
+ }
+}
diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.d.ts b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.d.ts
new file mode 100644
index 00000000000..8147620b211
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.d.ts
@@ -0,0 +1,2 @@
+declare class C {
+}
diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js
new file mode 100644
index 00000000000..8840c2117cf
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js
@@ -0,0 +1,6 @@
+var C = (function () {
+ function C() {
+ }
+ return C;
+})();
+//# sourceMappingURL=fileC.js.map
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js.map b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js.map
new file mode 100644
index 00000000000..de54805ee54
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"fileC.js","sourceRoot":"","sources":["../../../../FolderA/FolderB/FolderC/fileC.ts"],"names":["C","C.constructor"],"mappings":"AAAA;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"}
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.d.ts b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.d.ts
new file mode 100644
index 00000000000..4ff813c3839
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.d.ts
@@ -0,0 +1,4 @@
+///
+declare class B {
+ c: C;
+}
diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js
new file mode 100644
index 00000000000..84af55d2d89
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js
@@ -0,0 +1,7 @@
+///
+var B = (function () {
+ function B() {
+ }
+ return B;
+})();
+//# sourceMappingURL=fileB.js.map
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js.map b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js.map
new file mode 100644
index 00000000000..d1c844d3247
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"fileB.js","sourceRoot":"","sources":["../../../FolderA/FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AACA,AADA,wCAAwC;;IACxCA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"}
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.json b/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.json
new file mode 100644
index 00000000000..2ec18b3ac5a
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.json
@@ -0,0 +1,25 @@
+{
+ "scenario": "rootDirectory: specify rootDirectory",
+ "projectRoot": "tests/cases/projects/rootDirectory",
+ "inputFiles": [
+ "FolderA/FolderB/fileB.ts"
+ ],
+ "outDir": "outdir/simple",
+ "sourceMap": true,
+ "declaration": true,
+ "baselineCheck": true,
+ "rootDir": "FolderA",
+ "resolvedInputFiles": [
+ "lib.d.ts",
+ "FolderA/FolderB/FolderC/fileC.ts",
+ "FolderA/FolderB/fileB.ts"
+ ],
+ "emittedFiles": [
+ "outdir/simple/FolderB/FolderC/fileC.js.map",
+ "outdir/simple/FolderB/FolderC/fileC.js",
+ "outdir/simple/FolderB/FolderC/fileC.d.ts",
+ "outdir/simple/FolderB/fileB.js.map",
+ "outdir/simple/FolderB/fileB.js",
+ "outdir/simple/FolderB/fileB.d.ts"
+ ]
+}
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.sourcemap.txt b/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.sourcemap.txt
new file mode 100644
index 00000000000..83ee3b40181
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.sourcemap.txt
@@ -0,0 +1,123 @@
+===================================================================
+JsFile: fileC.js
+mapUrl: fileC.js.map
+sourceRoot:
+sources: ../../../../FolderA/FolderB/FolderC/fileC.ts
+===================================================================
+-------------------------------------------------------------------
+emittedFile:outdir/simple/FolderB/FolderC/fileC.js
+sourceFile:../../../../FolderA/FolderB/FolderC/fileC.ts
+-------------------------------------------------------------------
+>>>var C = (function () {
+1 >
+2 >^^^^^^^^^^^^^^^^^^^->
+1 >
+1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
+---
+>>> function C() {
+1->^^^^
+2 > ^^->
+1->
+1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) name (C)
+---
+>>> }
+1->^^^^
+2 > ^
+3 > ^^^^^^^^^->
+1->class C {
+ >
+2 > }
+1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (C.constructor)
+2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) name (C.constructor)
+---
+>>> return C;
+1->^^^^
+2 > ^^^^^^^^
+1->
+2 > }
+1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) name (C)
+2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) name (C)
+---
+>>>})();
+1 >
+2 >^
+3 >
+4 > ^^^^
+5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
+1 >
+2 >}
+3 >
+4 > class C {
+ > }
+1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) name (C)
+2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) name (C)
+3 >Emitted(5, 2) Source(1, 1) + SourceIndex(0)
+4 >Emitted(5, 6) Source(2, 2) + SourceIndex(0)
+---
+>>>//# sourceMappingURL=fileC.js.map===================================================================
+JsFile: fileB.js
+mapUrl: fileB.js.map
+sourceRoot:
+sources: ../../../FolderA/FolderB/fileB.ts
+===================================================================
+-------------------------------------------------------------------
+emittedFile:outdir/simple/FolderB/fileB.js
+sourceFile:../../../FolderA/FolderB/fileB.ts
+-------------------------------------------------------------------
+>>>///
+1 >
+2 >
+3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+1 >///
+ >
+2 >
+3 >///
+1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
+2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
+3 >Emitted(1, 41) Source(1, 41) + SourceIndex(0)
+---
+>>>var B = (function () {
+>>> function B() {
+1 >^^^^
+2 > ^^->
+1 >
+ >
+1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B)
+---
+>>> }
+1->^^^^
+2 > ^
+3 > ^^^^^^^^^->
+1->class B {
+ > public c: C;
+ >
+2 > }
+1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (B.constructor)
+2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (B.constructor)
+---
+>>> return B;
+1->^^^^
+2 > ^^^^^^^^
+1->
+2 > }
+1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (B)
+2 >Emitted(5, 13) Source(4, 2) + SourceIndex(0) name (B)
+---
+>>>})();
+1 >
+2 >^
+3 >
+4 > ^^^^
+5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
+1 >
+2 >}
+3 >
+4 > class B {
+ > public c: C;
+ > }
+1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (B)
+2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (B)
+3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0)
+4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0)
+---
+>>>//# sourceMappingURL=fileB.js.map
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.d.ts b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.d.ts
new file mode 100644
index 00000000000..8147620b211
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.d.ts
@@ -0,0 +1,2 @@
+declare class C {
+}
diff --git a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js
new file mode 100644
index 00000000000..8840c2117cf
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js
@@ -0,0 +1,6 @@
+var C = (function () {
+ function C() {
+ }
+ return C;
+})();
+//# sourceMappingURL=fileC.js.map
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js.map b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js.map
new file mode 100644
index 00000000000..de54805ee54
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"fileC.js","sourceRoot":"","sources":["../../../../FolderA/FolderB/FolderC/fileC.ts"],"names":["C","C.constructor"],"mappings":"AAAA;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"}
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.d.ts b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.d.ts
new file mode 100644
index 00000000000..4ff813c3839
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.d.ts
@@ -0,0 +1,4 @@
+///
+declare class B {
+ c: C;
+}
diff --git a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js
new file mode 100644
index 00000000000..84af55d2d89
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js
@@ -0,0 +1,7 @@
+///
+var B = (function () {
+ function B() {
+ }
+ return B;
+})();
+//# sourceMappingURL=fileB.js.map
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js.map b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js.map
new file mode 100644
index 00000000000..d1c844d3247
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"fileB.js","sourceRoot":"","sources":["../../../FolderA/FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AACA,AADA,wCAAwC;;IACxCA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"}
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectory/node/rootDirectory.json b/tests/baselines/reference/project/rootDirectory/node/rootDirectory.json
new file mode 100644
index 00000000000..2ec18b3ac5a
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectory/node/rootDirectory.json
@@ -0,0 +1,25 @@
+{
+ "scenario": "rootDirectory: specify rootDirectory",
+ "projectRoot": "tests/cases/projects/rootDirectory",
+ "inputFiles": [
+ "FolderA/FolderB/fileB.ts"
+ ],
+ "outDir": "outdir/simple",
+ "sourceMap": true,
+ "declaration": true,
+ "baselineCheck": true,
+ "rootDir": "FolderA",
+ "resolvedInputFiles": [
+ "lib.d.ts",
+ "FolderA/FolderB/FolderC/fileC.ts",
+ "FolderA/FolderB/fileB.ts"
+ ],
+ "emittedFiles": [
+ "outdir/simple/FolderB/FolderC/fileC.js.map",
+ "outdir/simple/FolderB/FolderC/fileC.js",
+ "outdir/simple/FolderB/FolderC/fileC.d.ts",
+ "outdir/simple/FolderB/fileB.js.map",
+ "outdir/simple/FolderB/fileB.js",
+ "outdir/simple/FolderB/fileB.d.ts"
+ ]
+}
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectory/node/rootDirectory.sourcemap.txt b/tests/baselines/reference/project/rootDirectory/node/rootDirectory.sourcemap.txt
new file mode 100644
index 00000000000..83ee3b40181
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectory/node/rootDirectory.sourcemap.txt
@@ -0,0 +1,123 @@
+===================================================================
+JsFile: fileC.js
+mapUrl: fileC.js.map
+sourceRoot:
+sources: ../../../../FolderA/FolderB/FolderC/fileC.ts
+===================================================================
+-------------------------------------------------------------------
+emittedFile:outdir/simple/FolderB/FolderC/fileC.js
+sourceFile:../../../../FolderA/FolderB/FolderC/fileC.ts
+-------------------------------------------------------------------
+>>>var C = (function () {
+1 >
+2 >^^^^^^^^^^^^^^^^^^^->
+1 >
+1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
+---
+>>> function C() {
+1->^^^^
+2 > ^^->
+1->
+1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) name (C)
+---
+>>> }
+1->^^^^
+2 > ^
+3 > ^^^^^^^^^->
+1->class C {
+ >
+2 > }
+1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (C.constructor)
+2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) name (C.constructor)
+---
+>>> return C;
+1->^^^^
+2 > ^^^^^^^^
+1->
+2 > }
+1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) name (C)
+2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) name (C)
+---
+>>>})();
+1 >
+2 >^
+3 >
+4 > ^^^^
+5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
+1 >
+2 >}
+3 >
+4 > class C {
+ > }
+1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) name (C)
+2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) name (C)
+3 >Emitted(5, 2) Source(1, 1) + SourceIndex(0)
+4 >Emitted(5, 6) Source(2, 2) + SourceIndex(0)
+---
+>>>//# sourceMappingURL=fileC.js.map===================================================================
+JsFile: fileB.js
+mapUrl: fileB.js.map
+sourceRoot:
+sources: ../../../FolderA/FolderB/fileB.ts
+===================================================================
+-------------------------------------------------------------------
+emittedFile:outdir/simple/FolderB/fileB.js
+sourceFile:../../../FolderA/FolderB/fileB.ts
+-------------------------------------------------------------------
+>>>///
+1 >
+2 >
+3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+1 >///
+ >
+2 >
+3 >///
+1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
+2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
+3 >Emitted(1, 41) Source(1, 41) + SourceIndex(0)
+---
+>>>var B = (function () {
+>>> function B() {
+1 >^^^^
+2 > ^^->
+1 >
+ >
+1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B)
+---
+>>> }
+1->^^^^
+2 > ^
+3 > ^^^^^^^^^->
+1->class B {
+ > public c: C;
+ >
+2 > }
+1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (B.constructor)
+2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (B.constructor)
+---
+>>> return B;
+1->^^^^
+2 > ^^^^^^^^
+1->
+2 > }
+1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (B)
+2 >Emitted(5, 13) Source(4, 2) + SourceIndex(0) name (B)
+---
+>>>})();
+1 >
+2 >^
+3 >
+4 > ^^^^
+5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
+1 >
+2 >}
+3 >
+4 > class B {
+ > public c: C;
+ > }
+1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (B)
+2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (B)
+3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0)
+4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0)
+---
+>>>//# sourceMappingURL=fileB.js.map
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.d.ts b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.d.ts
new file mode 100644
index 00000000000..8147620b211
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.d.ts
@@ -0,0 +1,2 @@
+declare class C {
+}
diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.js
new file mode 100644
index 00000000000..325ac60ee32
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.js
@@ -0,0 +1,5 @@
+var C = (function () {
+ function C() {
+ }
+ return C;
+})();
diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.d.ts b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.d.ts
new file mode 100644
index 00000000000..4ff813c3839
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.d.ts
@@ -0,0 +1,4 @@
+///
+declare class B {
+ c: C;
+}
diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.js b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.js
new file mode 100644
index 00000000000..99199ca1742
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.js
@@ -0,0 +1,6 @@
+///
+var B = (function () {
+ function B() {
+ }
+ return B;
+})();
diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.errors.txt b/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.errors.txt
new file mode 100644
index 00000000000..dfbdd679685
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.errors.txt
@@ -0,0 +1,14 @@
+error TS6059: File 'FolderA/FolderB/fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files.
+
+
+!!! error TS6059: File 'fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files.
+==== FolderA/FolderB/FolderC/fileC.ts (0 errors) ====
+ class C {
+ }
+
+==== FolderA/FolderB/fileB.ts (0 errors) ====
+ ///
+ class B {
+ public c: C;
+ }
+
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.json b/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.json
new file mode 100644
index 00000000000..fdde42592ca
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.json
@@ -0,0 +1,22 @@
+{
+ "scenario": "rootDirectory: Files outside the rootDirectory",
+ "projectRoot": "tests/cases/projects/rootDirectory",
+ "inputFiles": [
+ "FolderA/FolderB/fileB.ts"
+ ],
+ "outDir": "outdir/simple",
+ "declaration": true,
+ "baselineCheck": true,
+ "rootDir": "FolderA/FolderB/FolderC",
+ "resolvedInputFiles": [
+ "lib.d.ts",
+ "FolderA/FolderB/FolderC/fileC.ts",
+ "FolderA/FolderB/fileB.ts"
+ ],
+ "emittedFiles": [
+ "outdir/simple/FolderC/fileC.js",
+ "outdir/simple/FolderC/fileC.d.ts",
+ "outdir/simple/fileB.js",
+ "outdir/simple/fileB.d.ts"
+ ]
+}
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.d.ts b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.d.ts
new file mode 100644
index 00000000000..8147620b211
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.d.ts
@@ -0,0 +1,2 @@
+declare class C {
+}
diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.js
new file mode 100644
index 00000000000..325ac60ee32
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.js
@@ -0,0 +1,5 @@
+var C = (function () {
+ function C() {
+ }
+ return C;
+})();
diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.d.ts b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.d.ts
new file mode 100644
index 00000000000..4ff813c3839
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.d.ts
@@ -0,0 +1,4 @@
+///
+declare class B {
+ c: C;
+}
diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.js b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.js
new file mode 100644
index 00000000000..99199ca1742
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.js
@@ -0,0 +1,6 @@
+///
+var B = (function () {
+ function B() {
+ }
+ return B;
+})();
diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.errors.txt b/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.errors.txt
new file mode 100644
index 00000000000..dfbdd679685
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.errors.txt
@@ -0,0 +1,14 @@
+error TS6059: File 'FolderA/FolderB/fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files.
+
+
+!!! error TS6059: File 'fileB.ts' is not under 'rootDir' 'FolderA/FolderB/FolderC'. 'rootDir' is expected to contain all source files.
+==== FolderA/FolderB/FolderC/fileC.ts (0 errors) ====
+ class C {
+ }
+
+==== FolderA/FolderB/fileB.ts (0 errors) ====
+ ///
+ class B {
+ public c: C;
+ }
+
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.json b/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.json
new file mode 100644
index 00000000000..fdde42592ca
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.json
@@ -0,0 +1,22 @@
+{
+ "scenario": "rootDirectory: Files outside the rootDirectory",
+ "projectRoot": "tests/cases/projects/rootDirectory",
+ "inputFiles": [
+ "FolderA/FolderB/fileB.ts"
+ ],
+ "outDir": "outdir/simple",
+ "declaration": true,
+ "baselineCheck": true,
+ "rootDir": "FolderA/FolderB/FolderC",
+ "resolvedInputFiles": [
+ "lib.d.ts",
+ "FolderA/FolderB/FolderC/fileC.ts",
+ "FolderA/FolderB/fileB.ts"
+ ],
+ "emittedFiles": [
+ "outdir/simple/FolderC/fileC.js",
+ "outdir/simple/FolderC/fileC.d.ts",
+ "outdir/simple/fileB.js",
+ "outdir/simple/fileB.d.ts"
+ ]
+}
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js
new file mode 100644
index 00000000000..8840c2117cf
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js
@@ -0,0 +1,6 @@
+var C = (function () {
+ function C() {
+ }
+ return C;
+})();
+//# sourceMappingURL=fileC.js.map
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js.map b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js.map
new file mode 100644
index 00000000000..9a35f3fbc3e
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"fileC.js","sourceRoot":"SourceRootPath/","sources":["FolderB/FolderC/fileC.ts"],"names":["C","C.constructor"],"mappings":"AAAA;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"}
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js
new file mode 100644
index 00000000000..84af55d2d89
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js
@@ -0,0 +1,7 @@
+///
+var B = (function () {
+ function B() {
+ }
+ return B;
+})();
+//# sourceMappingURL=fileB.js.map
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js.map b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js.map
new file mode 100644
index 00000000000..16a45385420
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"fileB.js","sourceRoot":"SourceRootPath/","sources":["FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AACA,AADA,wCAAwC;;IACxCA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"}
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.json b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.json
new file mode 100644
index 00000000000..deb12150736
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.json
@@ -0,0 +1,23 @@
+{
+ "scenario": "rootDirectory: specify rootDirectory with sourceRoot",
+ "projectRoot": "tests/cases/projects/rootDirectory",
+ "inputFiles": [
+ "FolderA/FolderB/fileB.ts"
+ ],
+ "outDir": "outdir/simple",
+ "sourceMap": true,
+ "sourceRoot": "SourceRootPath",
+ "baselineCheck": true,
+ "rootDir": "FolderA",
+ "resolvedInputFiles": [
+ "lib.d.ts",
+ "FolderA/FolderB/FolderC/fileC.ts",
+ "FolderA/FolderB/fileB.ts"
+ ],
+ "emittedFiles": [
+ "outdir/simple/FolderB/FolderC/fileC.js.map",
+ "outdir/simple/FolderB/FolderC/fileC.js",
+ "outdir/simple/FolderB/fileB.js.map",
+ "outdir/simple/FolderB/fileB.js"
+ ]
+}
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.sourcemap.txt b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.sourcemap.txt
new file mode 100644
index 00000000000..7c5843bdd34
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.sourcemap.txt
@@ -0,0 +1,123 @@
+===================================================================
+JsFile: fileC.js
+mapUrl: fileC.js.map
+sourceRoot: SourceRootPath/
+sources: FolderB/FolderC/fileC.ts
+===================================================================
+-------------------------------------------------------------------
+emittedFile:outdir/simple/FolderB/FolderC/fileC.js
+sourceFile:FolderB/FolderC/fileC.ts
+-------------------------------------------------------------------
+>>>var C = (function () {
+1 >
+2 >^^^^^^^^^^^^^^^^^^^->
+1 >
+1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
+---
+>>> function C() {
+1->^^^^
+2 > ^^->
+1->
+1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) name (C)
+---
+>>> }
+1->^^^^
+2 > ^
+3 > ^^^^^^^^^->
+1->class C {
+ >
+2 > }
+1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (C.constructor)
+2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) name (C.constructor)
+---
+>>> return C;
+1->^^^^
+2 > ^^^^^^^^
+1->
+2 > }
+1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) name (C)
+2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) name (C)
+---
+>>>})();
+1 >
+2 >^
+3 >
+4 > ^^^^
+5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
+1 >
+2 >}
+3 >
+4 > class C {
+ > }
+1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) name (C)
+2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) name (C)
+3 >Emitted(5, 2) Source(1, 1) + SourceIndex(0)
+4 >Emitted(5, 6) Source(2, 2) + SourceIndex(0)
+---
+>>>//# sourceMappingURL=fileC.js.map===================================================================
+JsFile: fileB.js
+mapUrl: fileB.js.map
+sourceRoot: SourceRootPath/
+sources: FolderB/fileB.ts
+===================================================================
+-------------------------------------------------------------------
+emittedFile:outdir/simple/FolderB/fileB.js
+sourceFile:FolderB/fileB.ts
+-------------------------------------------------------------------
+>>>///
+1 >
+2 >
+3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+1 >///
+ >
+2 >
+3 >///
+1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
+2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
+3 >Emitted(1, 41) Source(1, 41) + SourceIndex(0)
+---
+>>>var B = (function () {
+>>> function B() {
+1 >^^^^
+2 > ^^->
+1 >
+ >
+1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B)
+---
+>>> }
+1->^^^^
+2 > ^
+3 > ^^^^^^^^^->
+1->class B {
+ > public c: C;
+ >
+2 > }
+1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (B.constructor)
+2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (B.constructor)
+---
+>>> return B;
+1->^^^^
+2 > ^^^^^^^^
+1->
+2 > }
+1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (B)
+2 >Emitted(5, 13) Source(4, 2) + SourceIndex(0) name (B)
+---
+>>>})();
+1 >
+2 >^
+3 >
+4 > ^^^^
+5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
+1 >
+2 >}
+3 >
+4 > class B {
+ > public c: C;
+ > }
+1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (B)
+2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (B)
+3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0)
+4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0)
+---
+>>>//# sourceMappingURL=fileB.js.map
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js
new file mode 100644
index 00000000000..8840c2117cf
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js
@@ -0,0 +1,6 @@
+var C = (function () {
+ function C() {
+ }
+ return C;
+})();
+//# sourceMappingURL=fileC.js.map
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js.map b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js.map
new file mode 100644
index 00000000000..9a35f3fbc3e
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"fileC.js","sourceRoot":"SourceRootPath/","sources":["FolderB/FolderC/fileC.ts"],"names":["C","C.constructor"],"mappings":"AAAA;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"}
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js
new file mode 100644
index 00000000000..84af55d2d89
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js
@@ -0,0 +1,7 @@
+///
+var B = (function () {
+ function B() {
+ }
+ return B;
+})();
+//# sourceMappingURL=fileB.js.map
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js.map b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js.map
new file mode 100644
index 00000000000..16a45385420
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"fileB.js","sourceRoot":"SourceRootPath/","sources":["FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AACA,AADA,wCAAwC;;IACxCA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"}
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.json b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.json
new file mode 100644
index 00000000000..deb12150736
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.json
@@ -0,0 +1,23 @@
+{
+ "scenario": "rootDirectory: specify rootDirectory with sourceRoot",
+ "projectRoot": "tests/cases/projects/rootDirectory",
+ "inputFiles": [
+ "FolderA/FolderB/fileB.ts"
+ ],
+ "outDir": "outdir/simple",
+ "sourceMap": true,
+ "sourceRoot": "SourceRootPath",
+ "baselineCheck": true,
+ "rootDir": "FolderA",
+ "resolvedInputFiles": [
+ "lib.d.ts",
+ "FolderA/FolderB/FolderC/fileC.ts",
+ "FolderA/FolderB/fileB.ts"
+ ],
+ "emittedFiles": [
+ "outdir/simple/FolderB/FolderC/fileC.js.map",
+ "outdir/simple/FolderB/FolderC/fileC.js",
+ "outdir/simple/FolderB/fileB.js.map",
+ "outdir/simple/FolderB/fileB.js"
+ ]
+}
\ No newline at end of file
diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.sourcemap.txt b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.sourcemap.txt
new file mode 100644
index 00000000000..7c5843bdd34
--- /dev/null
+++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.sourcemap.txt
@@ -0,0 +1,123 @@
+===================================================================
+JsFile: fileC.js
+mapUrl: fileC.js.map
+sourceRoot: SourceRootPath/
+sources: FolderB/FolderC/fileC.ts
+===================================================================
+-------------------------------------------------------------------
+emittedFile:outdir/simple/FolderB/FolderC/fileC.js
+sourceFile:FolderB/FolderC/fileC.ts
+-------------------------------------------------------------------
+>>>var C = (function () {
+1 >
+2 >^^^^^^^^^^^^^^^^^^^->
+1 >
+1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
+---
+>>> function C() {
+1->^^^^
+2 > ^^->
+1->
+1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) name (C)
+---
+>>> }
+1->^^^^
+2 > ^
+3 > ^^^^^^^^^->
+1->class C {
+ >
+2 > }
+1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (C.constructor)
+2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) name (C.constructor)
+---
+>>> return C;
+1->^^^^
+2 > ^^^^^^^^
+1->
+2 > }
+1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) name (C)
+2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) name (C)
+---
+>>>})();
+1 >
+2 >^
+3 >
+4 > ^^^^
+5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
+1 >
+2 >}
+3 >
+4 > class C {
+ > }
+1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) name (C)
+2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) name (C)
+3 >Emitted(5, 2) Source(1, 1) + SourceIndex(0)
+4 >Emitted(5, 6) Source(2, 2) + SourceIndex(0)
+---
+>>>//# sourceMappingURL=fileC.js.map===================================================================
+JsFile: fileB.js
+mapUrl: fileB.js.map
+sourceRoot: SourceRootPath/
+sources: FolderB/fileB.ts
+===================================================================
+-------------------------------------------------------------------
+emittedFile:outdir/simple/FolderB/fileB.js
+sourceFile:FolderB/fileB.ts
+-------------------------------------------------------------------
+>>>///
+1 >
+2 >
+3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+1 >///
+ >
+2 >
+3 >///
+1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
+2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
+3 >Emitted(1, 41) Source(1, 41) + SourceIndex(0)
+---
+>>>var B = (function () {
+>>> function B() {
+1 >^^^^
+2 > ^^->
+1 >
+ >
+1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B)
+---
+>>> }
+1->^^^^
+2 > ^
+3 > ^^^^^^^^^->
+1->class B {
+ > public c: C;
+ >
+2 > }
+1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (B.constructor)
+2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (B.constructor)
+---
+>>> return B;
+1->^^^^
+2 > ^^^^^^^^
+1->
+2 > }
+1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (B)
+2 >Emitted(5, 13) Source(4, 2) + SourceIndex(0) name (B)
+---
+>>>})();
+1 >
+2 >^
+3 >
+4 > ^^^^
+5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
+1 >
+2 >}
+3 >
+4 > class B {
+ > public c: C;
+ > }
+1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (B)
+2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (B)
+3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0)
+4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0)
+---
+>>>//# sourceMappingURL=fileB.js.map
\ No newline at end of file
diff --git a/tests/baselines/reference/sourceMapValidationDecorators.js b/tests/baselines/reference/sourceMapValidationDecorators.js
index 5577a6967cd..d5a63997ea7 100644
--- a/tests/baselines/reference/sourceMapValidationDecorators.js
+++ b/tests/baselines/reference/sourceMapValidationDecorators.js
@@ -55,7 +55,8 @@ class Greeter {
}
//// [sourceMapValidationDecorators.js]
-var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+var __decorate = this.__decorate || function (decorators, target, key, desc) {
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
diff --git a/tests/baselines/reference/sourceMapValidationDecorators.js.map b/tests/baselines/reference/sourceMapValidationDecorators.js.map
index 84ebad316fa..d0e29441661 100644
--- a/tests/baselines/reference/sourceMapValidationDecorators.js.map
+++ b/tests/baselines/reference/sourceMapValidationDecorators.js.map
@@ -1,2 +1,2 @@
//// [sourceMapValidationDecorators.js.map]
-{"version":3,"file":"sourceMapValidationDecorators.js","sourceRoot":"","sources":["sourceMapValidationDecorators.ts"],"names":["Greeter","Greeter.constructor","Greeter.greet","Greeter.fn","Greeter.greetings"],"mappings":";;;;;;;;AAOA;IAGIA,iBAGSA,QAAgBA;QAEvBC,WAEcA;aAFdA,WAEcA,CAFdA,sBAEcA,CAFdA,IAEcA;YAFdA,0BAEcA;;QAJPA,aAAQA,GAARA,QAAQA,CAAQA;IAKzBA,CAACA;IAIDD,uBAAKA,GAFLA;QAGIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;IAC5CA,CAACA;IAUOF,oBAAEA,GAAVA,UAGEA,CAASA;QACPG,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;IACzBA,CAACA;IAEDH,sBAEIA,8BAASA;aAFbA;YAGII,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;QACzBA,CAACA;aAEDJ,UAGEA,SAAiBA;YACfI,IAAIA,CAACA,QAAQA,GAAGA,SAASA,CAACA;QAC9BA,CAACA;;;OAPAJ;IAbcA,UAAEA,GAAWA,EAAEA,CAACA;IAZ/BA,sBAEAA,0BAAKA;;YAFJA,kBAAkBA;YAClBA,kBAAkBA,CAACA,EAAEA,CAACA;WACvBA,0BAAKA,kCAALA,0BAAKA,IAEJA;IAEDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACfA,sBAACA,EAASA;IAMlBA,sBAAQA,uBAAEA;;YACRA,WAACA,mBAAmBA,CAAAA;YACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;WAFlBA,uBAAEA,kCAAFA,uBAAEA,IAKTA;IAEDA,sBAEIA,8BAASA;;YAFZA,kBAAkBA;YAClBA,kBAAkBA,CAACA,EAAEA,CAACA;YAMrBA,WAACA,mBAAmBA,CAAAA;YACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;WANtBA,8BAASA,kCAATA,8BAASA,IAEZA;IAfDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACRA,aAAEA,EAAcA;IAzBnCA;QAACA,eAAeA;QACfA,eAAeA,CAACA,EAAEA,CAACA;QAGdA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;QAGxBA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;gBAqC7BA;IAADA,cAACA;AAADA,CAACA,AA9CD,IA8CC"}
\ No newline at end of file
+{"version":3,"file":"sourceMapValidationDecorators.js","sourceRoot":"","sources":["sourceMapValidationDecorators.ts"],"names":["Greeter","Greeter.constructor","Greeter.greet","Greeter.fn","Greeter.greetings"],"mappings":";;;;;;;;;AAOA;IAGIA,iBAGSA,QAAgBA;QAEvBC,WAEcA;aAFdA,WAEcA,CAFdA,sBAEcA,CAFdA,IAEcA;YAFdA,0BAEcA;;QAJPA,aAAQA,GAARA,QAAQA,CAAQA;IAKzBA,CAACA;IAIDD,uBAAKA,GAFLA;QAGIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;IAC5CA,CAACA;IAUOF,oBAAEA,GAAVA,UAGEA,CAASA;QACPG,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;IACzBA,CAACA;IAEDH,sBAEIA,8BAASA;aAFbA;YAGII,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;QACzBA,CAACA;aAEDJ,UAGEA,SAAiBA;YACfI,IAAIA,CAACA,QAAQA,GAAGA,SAASA,CAACA;QAC9BA,CAACA;;;OAPAJ;IAbcA,UAAEA,GAAWA,EAAEA,CAACA;IAZ/BA,sBAEAA,0BAAKA;;YAFJA,kBAAkBA;YAClBA,kBAAkBA,CAACA,EAAEA,CAACA;WACvBA,0BAAKA,kCAALA,0BAAKA,IAEJA;IAEDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACfA,sBAACA,EAASA;IAMlBA,sBAAQA,uBAAEA;;YACRA,WAACA,mBAAmBA,CAAAA;YACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;WAFlBA,uBAAEA,kCAAFA,uBAAEA,IAKTA;IAEDA,sBAEIA,8BAASA;;YAFZA,kBAAkBA;YAClBA,kBAAkBA,CAACA,EAAEA,CAACA;YAMrBA,WAACA,mBAAmBA,CAAAA;YACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;WANtBA,8BAASA,kCAATA,8BAASA,IAEZA;IAfDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACRA,aAAEA,EAAcA;IAzBnCA;QAACA,eAAeA;QACfA,eAAeA,CAACA,EAAEA,CAACA;QAGdA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;QAGxBA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;gBAqC7BA;IAADA,cAACA;AAADA,CAACA,AA9CD,IA8CC"}
\ No newline at end of file
diff --git a/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt
index f4c64c49579..cde46038669 100644
--- a/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt
+++ b/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt
@@ -8,7 +8,8 @@ sources: sourceMapValidationDecorators.ts
emittedFile:tests/cases/compiler/sourceMapValidationDecorators.js
sourceFile:sourceMapValidationDecorators.ts
-------------------------------------------------------------------
->>>var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) {
+>>>var __decorate = this.__decorate || function (decorators, target, key, desc) {
+>>> if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
>>> switch (arguments.length) {
>>> case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
>>> case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
@@ -27,7 +28,7 @@ sourceFile:sourceMapValidationDecorators.ts
>declare function ParameterDecorator2(x: number): (target: Function, key: string | symbol, paramIndex: number) => void;
>
>
-1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0)
+1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0)
---
>>> function Greeter(greeting) {
1->^^^^
@@ -42,9 +43,9 @@ sourceFile:sourceMapValidationDecorators.ts
> @ParameterDecorator2(20)
> public
3 > greeting: string
-1->Emitted(10, 5) Source(11, 5) + SourceIndex(0) name (Greeter)
-2 >Emitted(10, 22) Source(14, 14) + SourceIndex(0) name (Greeter)
-3 >Emitted(10, 30) Source(14, 30) + SourceIndex(0) name (Greeter)
+1->Emitted(11, 5) Source(11, 5) + SourceIndex(0) name (Greeter)
+2 >Emitted(11, 22) Source(14, 14) + SourceIndex(0) name (Greeter)
+3 >Emitted(11, 30) Source(14, 30) + SourceIndex(0) name (Greeter)
---
>>> var b = [];
1 >^^^^^^^^
@@ -56,8 +57,8 @@ sourceFile:sourceMapValidationDecorators.ts
2 > @ParameterDecorator1
> @ParameterDecorator2(30)
> ...b: string[]
-1 >Emitted(11, 9) Source(16, 7) + SourceIndex(0) name (Greeter.constructor)
-2 >Emitted(11, 20) Source(18, 21) + SourceIndex(0) name (Greeter.constructor)
+1 >Emitted(12, 9) Source(16, 7) + SourceIndex(0) name (Greeter.constructor)
+2 >Emitted(12, 20) Source(18, 21) + SourceIndex(0) name (Greeter.constructor)
---
>>> for (var _i = 1; _i < arguments.length; _i++) {
1->^^^^^^^^^^^^^
@@ -78,12 +79,12 @@ sourceFile:sourceMapValidationDecorators.ts
6 > @ParameterDecorator1
> @ParameterDecorator2(30)
> ...b: string[]
-1->Emitted(12, 14) Source(16, 7) + SourceIndex(0) name (Greeter.constructor)
-2 >Emitted(12, 25) Source(18, 21) + SourceIndex(0) name (Greeter.constructor)
-3 >Emitted(12, 26) Source(16, 7) + SourceIndex(0) name (Greeter.constructor)
-4 >Emitted(12, 48) Source(18, 21) + SourceIndex(0) name (Greeter.constructor)
-5 >Emitted(12, 49) Source(16, 7) + SourceIndex(0) name (Greeter.constructor)
-6 >Emitted(12, 53) Source(18, 21) + SourceIndex(0) name (Greeter.constructor)
+1->Emitted(13, 14) Source(16, 7) + SourceIndex(0) name (Greeter.constructor)
+2 >Emitted(13, 25) Source(18, 21) + SourceIndex(0) name (Greeter.constructor)
+3 >Emitted(13, 26) Source(16, 7) + SourceIndex(0) name (Greeter.constructor)
+4 >Emitted(13, 48) Source(18, 21) + SourceIndex(0) name (Greeter.constructor)
+5 >Emitted(13, 49) Source(16, 7) + SourceIndex(0) name (Greeter.constructor)
+6 >Emitted(13, 53) Source(18, 21) + SourceIndex(0) name (Greeter.constructor)
---
>>> b[_i - 1] = arguments[_i];
1 >^^^^^^^^^^^^
@@ -92,8 +93,8 @@ sourceFile:sourceMapValidationDecorators.ts
2 > @ParameterDecorator1
> @ParameterDecorator2(30)
> ...b: string[]
-1 >Emitted(13, 13) Source(16, 7) + SourceIndex(0) name (Greeter.constructor)
-2 >Emitted(13, 39) Source(18, 21) + SourceIndex(0) name (Greeter.constructor)
+1 >Emitted(14, 13) Source(16, 7) + SourceIndex(0) name (Greeter.constructor)
+2 >Emitted(14, 39) Source(18, 21) + SourceIndex(0) name (Greeter.constructor)
---
>>> }
>>> this.greeting = greeting;
@@ -107,11 +108,11 @@ sourceFile:sourceMapValidationDecorators.ts
3 >
4 > greeting
5 > : string
-1 >Emitted(15, 9) Source(14, 14) + SourceIndex(0) name (Greeter.constructor)
-2 >Emitted(15, 22) Source(14, 22) + SourceIndex(0) name (Greeter.constructor)
-3 >Emitted(15, 25) Source(14, 14) + SourceIndex(0) name (Greeter.constructor)
-4 >Emitted(15, 33) Source(14, 22) + SourceIndex(0) name (Greeter.constructor)
-5 >Emitted(15, 34) Source(14, 30) + SourceIndex(0) name (Greeter.constructor)
+1 >Emitted(16, 9) Source(14, 14) + SourceIndex(0) name (Greeter.constructor)
+2 >Emitted(16, 22) Source(14, 22) + SourceIndex(0) name (Greeter.constructor)
+3 >Emitted(16, 25) Source(14, 14) + SourceIndex(0) name (Greeter.constructor)
+4 >Emitted(16, 33) Source(14, 22) + SourceIndex(0) name (Greeter.constructor)
+5 >Emitted(16, 34) Source(14, 30) + SourceIndex(0) name (Greeter.constructor)
---
>>> }
1 >^^^^
@@ -124,8 +125,8 @@ sourceFile:sourceMapValidationDecorators.ts
> ...b: string[]) {
>
2 > }
-1 >Emitted(16, 5) Source(19, 5) + SourceIndex(0) name (Greeter.constructor)
-2 >Emitted(16, 6) Source(19, 6) + SourceIndex(0) name (Greeter.constructor)
+1 >Emitted(17, 5) Source(19, 5) + SourceIndex(0) name (Greeter.constructor)
+2 >Emitted(17, 6) Source(19, 6) + SourceIndex(0) name (Greeter.constructor)
---
>>> Greeter.prototype.greet = function () {
1->^^^^
@@ -139,9 +140,9 @@ sourceFile:sourceMapValidationDecorators.ts
>
2 > greet
3 >
-1->Emitted(17, 5) Source(23, 5) + SourceIndex(0) name (Greeter)
-2 >Emitted(17, 28) Source(23, 10) + SourceIndex(0) name (Greeter)
-3 >Emitted(17, 31) Source(21, 5) + SourceIndex(0) name (Greeter)
+1->Emitted(18, 5) Source(23, 5) + SourceIndex(0) name (Greeter)
+2 >Emitted(18, 28) Source(23, 10) + SourceIndex(0) name (Greeter)
+3 >Emitted(18, 31) Source(21, 5) + SourceIndex(0) name (Greeter)
---
>>> return "" + this.greeting + "
";
1->^^^^^^^^
@@ -169,17 +170,17 @@ sourceFile:sourceMapValidationDecorators.ts
9 > +
10> ""
11> ;
-1->Emitted(18, 9) Source(24, 9) + SourceIndex(0) name (Greeter.greet)
-2 >Emitted(18, 15) Source(24, 15) + SourceIndex(0) name (Greeter.greet)
-3 >Emitted(18, 16) Source(24, 16) + SourceIndex(0) name (Greeter.greet)
-4 >Emitted(18, 22) Source(24, 22) + SourceIndex(0) name (Greeter.greet)
-5 >Emitted(18, 25) Source(24, 25) + SourceIndex(0) name (Greeter.greet)
-6 >Emitted(18, 29) Source(24, 29) + SourceIndex(0) name (Greeter.greet)
-7 >Emitted(18, 30) Source(24, 30) + SourceIndex(0) name (Greeter.greet)
-8 >Emitted(18, 38) Source(24, 38) + SourceIndex(0) name (Greeter.greet)
-9 >Emitted(18, 41) Source(24, 41) + SourceIndex(0) name (Greeter.greet)
-10>Emitted(18, 48) Source(24, 48) + SourceIndex(0) name (Greeter.greet)
-11>Emitted(18, 49) Source(24, 49) + SourceIndex(0) name (Greeter.greet)
+1->Emitted(19, 9) Source(24, 9) + SourceIndex(0) name (Greeter.greet)
+2 >Emitted(19, 15) Source(24, 15) + SourceIndex(0) name (Greeter.greet)
+3 >Emitted(19, 16) Source(24, 16) + SourceIndex(0) name (Greeter.greet)
+4 >Emitted(19, 22) Source(24, 22) + SourceIndex(0) name (Greeter.greet)
+5 >Emitted(19, 25) Source(24, 25) + SourceIndex(0) name (Greeter.greet)
+6 >Emitted(19, 29) Source(24, 29) + SourceIndex(0) name (Greeter.greet)
+7 >Emitted(19, 30) Source(24, 30) + SourceIndex(0) name (Greeter.greet)
+8 >Emitted(19, 38) Source(24, 38) + SourceIndex(0) name (Greeter.greet)
+9 >Emitted(19, 41) Source(24, 41) + SourceIndex(0) name (Greeter.greet)
+10>Emitted(19, 48) Source(24, 48) + SourceIndex(0) name (Greeter.greet)
+11>Emitted(19, 49) Source(24, 49) + SourceIndex(0) name (Greeter.greet)
---
>>> };
1 >^^^^
@@ -188,8 +189,8 @@ sourceFile:sourceMapValidationDecorators.ts
1 >
>
2 > }
-1 >Emitted(19, 5) Source(25, 5) + SourceIndex(0) name (Greeter.greet)
-2 >Emitted(19, 6) Source(25, 6) + SourceIndex(0) name (Greeter.greet)
+1 >Emitted(20, 5) Source(25, 5) + SourceIndex(0) name (Greeter.greet)
+2 >Emitted(20, 6) Source(25, 6) + SourceIndex(0) name (Greeter.greet)
---
>>> Greeter.prototype.fn = function (x) {
1->^^^^
@@ -215,11 +216,11 @@ sourceFile:sourceMapValidationDecorators.ts
> @ParameterDecorator2(70)
>
5 > x: number
-1->Emitted(20, 5) Source(35, 13) + SourceIndex(0) name (Greeter)
-2 >Emitted(20, 25) Source(35, 15) + SourceIndex(0) name (Greeter)
-3 >Emitted(20, 28) Source(35, 5) + SourceIndex(0) name (Greeter)
-4 >Emitted(20, 38) Source(38, 7) + SourceIndex(0) name (Greeter)
-5 >Emitted(20, 39) Source(38, 16) + SourceIndex(0) name (Greeter)
+1->Emitted(21, 5) Source(35, 13) + SourceIndex(0) name (Greeter)
+2 >Emitted(21, 25) Source(35, 15) + SourceIndex(0) name (Greeter)
+3 >Emitted(21, 28) Source(35, 5) + SourceIndex(0) name (Greeter)
+4 >Emitted(21, 38) Source(38, 7) + SourceIndex(0) name (Greeter)
+5 >Emitted(21, 39) Source(38, 16) + SourceIndex(0) name (Greeter)
---
>>> return this.greeting;
1 >^^^^^^^^
@@ -237,13 +238,13 @@ sourceFile:sourceMapValidationDecorators.ts
5 > .
6 > greeting
7 > ;
-1 >Emitted(21, 9) Source(39, 9) + SourceIndex(0) name (Greeter.fn)
-2 >Emitted(21, 15) Source(39, 15) + SourceIndex(0) name (Greeter.fn)
-3 >Emitted(21, 16) Source(39, 16) + SourceIndex(0) name (Greeter.fn)
-4 >Emitted(21, 20) Source(39, 20) + SourceIndex(0) name (Greeter.fn)
-5 >Emitted(21, 21) Source(39, 21) + SourceIndex(0) name (Greeter.fn)
-6 >Emitted(21, 29) Source(39, 29) + SourceIndex(0) name (Greeter.fn)
-7 >Emitted(21, 30) Source(39, 30) + SourceIndex(0) name (Greeter.fn)
+1 >Emitted(22, 9) Source(39, 9) + SourceIndex(0) name (Greeter.fn)
+2 >Emitted(22, 15) Source(39, 15) + SourceIndex(0) name (Greeter.fn)
+3 >Emitted(22, 16) Source(39, 16) + SourceIndex(0) name (Greeter.fn)
+4 >Emitted(22, 20) Source(39, 20) + SourceIndex(0) name (Greeter.fn)
+5 >Emitted(22, 21) Source(39, 21) + SourceIndex(0) name (Greeter.fn)
+6 >Emitted(22, 29) Source(39, 29) + SourceIndex(0) name (Greeter.fn)
+7 >Emitted(22, 30) Source(39, 30) + SourceIndex(0) name (Greeter.fn)
---
>>> };
1 >^^^^
@@ -252,8 +253,8 @@ sourceFile:sourceMapValidationDecorators.ts
1 >
>
2 > }
-1 >Emitted(22, 5) Source(40, 5) + SourceIndex(0) name (Greeter.fn)
-2 >Emitted(22, 6) Source(40, 6) + SourceIndex(0) name (Greeter.fn)
+1 >Emitted(23, 5) Source(40, 5) + SourceIndex(0) name (Greeter.fn)
+2 >Emitted(23, 6) Source(40, 6) + SourceIndex(0) name (Greeter.fn)
---
>>> Object.defineProperty(Greeter.prototype, "greetings", {
1->^^^^
@@ -266,15 +267,15 @@ sourceFile:sourceMapValidationDecorators.ts
> @PropertyDecorator2(80)
> get
3 > greetings
-1->Emitted(23, 5) Source(42, 5) + SourceIndex(0) name (Greeter)
-2 >Emitted(23, 27) Source(44, 9) + SourceIndex(0) name (Greeter)
-3 >Emitted(23, 57) Source(44, 18) + SourceIndex(0) name (Greeter)
+1->Emitted(24, 5) Source(42, 5) + SourceIndex(0) name (Greeter)
+2 >Emitted(24, 27) Source(44, 9) + SourceIndex(0) name (Greeter)
+3 >Emitted(24, 57) Source(44, 18) + SourceIndex(0) name (Greeter)
---
>>> get: function () {
1 >^^^^^^^^^^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^->
1 >
-1 >Emitted(24, 14) Source(42, 5) + SourceIndex(0) name (Greeter)
+1 >Emitted(25, 14) Source(42, 5) + SourceIndex(0) name (Greeter)
---
>>> return this.greeting;
1->^^^^^^^^^^^^
@@ -294,13 +295,13 @@ sourceFile:sourceMapValidationDecorators.ts
5 > .
6 > greeting
7 > ;
-1->Emitted(25, 13) Source(45, 9) + SourceIndex(0) name (Greeter.greetings)
-2 >Emitted(25, 19) Source(45, 15) + SourceIndex(0) name (Greeter.greetings)
-3 >Emitted(25, 20) Source(45, 16) + SourceIndex(0) name (Greeter.greetings)
-4 >Emitted(25, 24) Source(45, 20) + SourceIndex(0) name (Greeter.greetings)
-5 >Emitted(25, 25) Source(45, 21) + SourceIndex(0) name (Greeter.greetings)
-6 >Emitted(25, 33) Source(45, 29) + SourceIndex(0) name (Greeter.greetings)
-7 >Emitted(25, 34) Source(45, 30) + SourceIndex(0) name (Greeter.greetings)
+1->Emitted(26, 13) Source(45, 9) + SourceIndex(0) name (Greeter.greetings)
+2 >Emitted(26, 19) Source(45, 15) + SourceIndex(0) name (Greeter.greetings)
+3 >Emitted(26, 20) Source(45, 16) + SourceIndex(0) name (Greeter.greetings)
+4 >Emitted(26, 24) Source(45, 20) + SourceIndex(0) name (Greeter.greetings)
+5 >Emitted(26, 25) Source(45, 21) + SourceIndex(0) name (Greeter.greetings)
+6 >Emitted(26, 33) Source(45, 29) + SourceIndex(0) name (Greeter.greetings)
+7 >Emitted(26, 34) Source(45, 30) + SourceIndex(0) name (Greeter.greetings)
---
>>> },
1 >^^^^^^^^
@@ -309,8 +310,8 @@ sourceFile:sourceMapValidationDecorators.ts
1 >
>
2 > }
-1 >Emitted(26, 9) Source(46, 5) + SourceIndex(0) name (Greeter.greetings)
-2 >Emitted(26, 10) Source(46, 6) + SourceIndex(0) name (Greeter.greetings)
+1 >Emitted(27, 9) Source(46, 5) + SourceIndex(0) name (Greeter.greetings)
+2 >Emitted(27, 10) Source(46, 6) + SourceIndex(0) name (Greeter.greetings)
---
>>> set: function (greetings) {
1->^^^^^^^^^^^^^
@@ -325,9 +326,9 @@ sourceFile:sourceMapValidationDecorators.ts
> @ParameterDecorator2(90)
>
3 > greetings: string
-1->Emitted(27, 14) Source(48, 5) + SourceIndex(0) name (Greeter)
-2 >Emitted(27, 24) Source(51, 7) + SourceIndex(0) name (Greeter)
-3 >Emitted(27, 33) Source(51, 24) + SourceIndex(0) name (Greeter)
+1->Emitted(28, 14) Source(48, 5) + SourceIndex(0) name (Greeter)
+2 >Emitted(28, 24) Source(51, 7) + SourceIndex(0) name (Greeter)
+3 >Emitted(28, 33) Source(51, 24) + SourceIndex(0) name (Greeter)
---
>>> this.greeting = greetings;
1->^^^^^^^^^^^^
@@ -345,13 +346,13 @@ sourceFile:sourceMapValidationDecorators.ts
5 > =
6 > greetings
7 > ;
-1->Emitted(28, 13) Source(52, 9) + SourceIndex(0) name (Greeter.greetings)
-2 >Emitted(28, 17) Source(52, 13) + SourceIndex(0) name (Greeter.greetings)
-3 >Emitted(28, 18) Source(52, 14) + SourceIndex(0) name (Greeter.greetings)
-4 >Emitted(28, 26) Source(52, 22) + SourceIndex(0) name (Greeter.greetings)
-5 >Emitted(28, 29) Source(52, 25) + SourceIndex(0) name (Greeter.greetings)
-6 >Emitted(28, 38) Source(52, 34) + SourceIndex(0) name (Greeter.greetings)
-7 >Emitted(28, 39) Source(52, 35) + SourceIndex(0) name (Greeter.greetings)
+1->Emitted(29, 13) Source(52, 9) + SourceIndex(0) name (Greeter.greetings)
+2 >Emitted(29, 17) Source(52, 13) + SourceIndex(0) name (Greeter.greetings)
+3 >Emitted(29, 18) Source(52, 14) + SourceIndex(0) name (Greeter.greetings)
+4 >Emitted(29, 26) Source(52, 22) + SourceIndex(0) name (Greeter.greetings)
+5 >Emitted(29, 29) Source(52, 25) + SourceIndex(0) name (Greeter.greetings)
+6 >Emitted(29, 38) Source(52, 34) + SourceIndex(0) name (Greeter.greetings)
+7 >Emitted(29, 39) Source(52, 35) + SourceIndex(0) name (Greeter.greetings)
---
>>> },
1 >^^^^^^^^
@@ -360,8 +361,8 @@ sourceFile:sourceMapValidationDecorators.ts
1 >
>
2 > }
-1 >Emitted(29, 9) Source(53, 5) + SourceIndex(0) name (Greeter.greetings)
-2 >Emitted(29, 10) Source(53, 6) + SourceIndex(0) name (Greeter.greetings)
+1 >Emitted(30, 9) Source(53, 5) + SourceIndex(0) name (Greeter.greetings)
+2 >Emitted(30, 10) Source(53, 6) + SourceIndex(0) name (Greeter.greetings)
---
>>> enumerable: true,
>>> configurable: true
@@ -369,7 +370,7 @@ sourceFile:sourceMapValidationDecorators.ts
1->^^^^^^^
2 > ^^^^^^^^^^^^^^->
1->
-1->Emitted(32, 8) Source(46, 6) + SourceIndex(0) name (Greeter)
+1->Emitted(33, 8) Source(46, 6) + SourceIndex(0) name (Greeter)
---
>>> Greeter.x1 = 10;
1->^^^^
@@ -383,11 +384,11 @@ sourceFile:sourceMapValidationDecorators.ts
3 > : number =
4 > 10
5 > ;
-1->Emitted(33, 5) Source(33, 20) + SourceIndex(0) name (Greeter)
-2 >Emitted(33, 15) Source(33, 22) + SourceIndex(0) name (Greeter)
-3 >Emitted(33, 18) Source(33, 33) + SourceIndex(0) name (Greeter)
-4 >Emitted(33, 20) Source(33, 35) + SourceIndex(0) name (Greeter)
-5 >Emitted(33, 21) Source(33, 36) + SourceIndex(0) name (Greeter)
+1->Emitted(34, 5) Source(33, 20) + SourceIndex(0) name (Greeter)
+2 >Emitted(34, 15) Source(33, 22) + SourceIndex(0) name (Greeter)
+3 >Emitted(34, 18) Source(33, 33) + SourceIndex(0) name (Greeter)
+4 >Emitted(34, 20) Source(33, 35) + SourceIndex(0) name (Greeter)
+5 >Emitted(34, 21) Source(33, 36) + SourceIndex(0) name (Greeter)
---
>>> Object.defineProperty(Greeter.prototype, "greet",
1->^^^^
@@ -398,9 +399,9 @@ sourceFile:sourceMapValidationDecorators.ts
> @PropertyDecorator2(40)
>
3 > greet
-1->Emitted(34, 5) Source(21, 5) + SourceIndex(0) name (Greeter)
-2 >Emitted(34, 27) Source(23, 5) + SourceIndex(0) name (Greeter)
-3 >Emitted(34, 53) Source(23, 10) + SourceIndex(0) name (Greeter)
+1->Emitted(35, 5) Source(21, 5) + SourceIndex(0) name (Greeter)
+2 >Emitted(35, 27) Source(23, 5) + SourceIndex(0) name (Greeter)
+3 >Emitted(35, 53) Source(23, 10) + SourceIndex(0) name (Greeter)
---
>>> __decorate([
>>> PropertyDecorator1,
@@ -409,8 +410,8 @@ sourceFile:sourceMapValidationDecorators.ts
3 > ^^^^^->
1 >
2 > PropertyDecorator1
-1 >Emitted(36, 13) Source(21, 6) + SourceIndex(0) name (Greeter)
-2 >Emitted(36, 31) Source(21, 24) + SourceIndex(0) name (Greeter)
+1 >Emitted(37, 13) Source(21, 6) + SourceIndex(0) name (Greeter)
+2 >Emitted(37, 31) Source(21, 24) + SourceIndex(0) name (Greeter)
---
>>> PropertyDecorator2(40)
1->^^^^^^^^^^^^
@@ -425,11 +426,11 @@ sourceFile:sourceMapValidationDecorators.ts
3 > (
4 > 40
5 > )
-1->Emitted(37, 13) Source(22, 6) + SourceIndex(0) name (Greeter)
-2 >Emitted(37, 31) Source(22, 24) + SourceIndex(0) name (Greeter)
-3 >Emitted(37, 32) Source(22, 25) + SourceIndex(0) name (Greeter)
-4 >Emitted(37, 34) Source(22, 27) + SourceIndex(0) name (Greeter)
-5 >Emitted(37, 35) Source(22, 28) + SourceIndex(0) name (Greeter)
+1->Emitted(38, 13) Source(22, 6) + SourceIndex(0) name (Greeter)
+2 >Emitted(38, 31) Source(22, 24) + SourceIndex(0) name (Greeter)
+3 >Emitted(38, 32) Source(22, 25) + SourceIndex(0) name (Greeter)
+4 >Emitted(38, 34) Source(22, 27) + SourceIndex(0) name (Greeter)
+5 >Emitted(38, 35) Source(22, 28) + SourceIndex(0) name (Greeter)
---
>>> ], Greeter.prototype, "greet", Object.getOwnPropertyDescriptor(Greeter.prototype, "greet")));
1->^^^^^^^^^^^
@@ -445,11 +446,11 @@ sourceFile:sourceMapValidationDecorators.ts
5 > () {
> return "" + this.greeting + "
";
> }
-1->Emitted(38, 12) Source(23, 5) + SourceIndex(0) name (Greeter)
-2 >Emitted(38, 38) Source(23, 10) + SourceIndex(0) name (Greeter)
-3 >Emitted(38, 72) Source(23, 5) + SourceIndex(0) name (Greeter)
-4 >Emitted(38, 98) Source(23, 10) + SourceIndex(0) name (Greeter)
-5 >Emitted(38, 102) Source(25, 6) + SourceIndex(0) name (Greeter)
+1->Emitted(39, 12) Source(23, 5) + SourceIndex(0) name (Greeter)
+2 >Emitted(39, 38) Source(23, 10) + SourceIndex(0) name (Greeter)
+3 >Emitted(39, 72) Source(23, 5) + SourceIndex(0) name (Greeter)
+4 >Emitted(39, 98) Source(23, 10) + SourceIndex(0) name (Greeter)
+5 >Emitted(39, 102) Source(25, 6) + SourceIndex(0) name (Greeter)
---
>>> __decorate([
1 >^^^^
@@ -457,7 +458,7 @@ sourceFile:sourceMapValidationDecorators.ts
1 >
>
>
-1 >Emitted(39, 5) Source(27, 5) + SourceIndex(0) name (Greeter)
+1 >Emitted(40, 5) Source(27, 5) + SourceIndex(0) name (Greeter)
---
>>> PropertyDecorator1,
1->^^^^^^^^
@@ -465,8 +466,8 @@ sourceFile:sourceMapValidationDecorators.ts
3 > ^^^^^->
1->@
2 > PropertyDecorator1
-1->Emitted(40, 9) Source(27, 6) + SourceIndex(0) name (Greeter)
-2 >Emitted(40, 27) Source(27, 24) + SourceIndex(0) name (Greeter)
+1->Emitted(41, 9) Source(27, 6) + SourceIndex(0) name (Greeter)
+2 >Emitted(41, 27) Source(27, 24) + SourceIndex(0) name (Greeter)
---
>>> PropertyDecorator2(50)
1->^^^^^^^^
@@ -481,11 +482,11 @@ sourceFile:sourceMapValidationDecorators.ts
3 > (
4 > 50
5 > )
-1->Emitted(41, 9) Source(28, 6) + SourceIndex(0) name (Greeter)
-2 >Emitted(41, 27) Source(28, 24) + SourceIndex(0) name (Greeter)
-3 >Emitted(41, 28) Source(28, 25) + SourceIndex(0) name (Greeter)
-4 >Emitted(41, 30) Source(28, 27) + SourceIndex(0) name (Greeter)
-5 >Emitted(41, 31) Source(28, 28) + SourceIndex(0) name (Greeter)
+1->Emitted(42, 9) Source(28, 6) + SourceIndex(0) name (Greeter)
+2 >Emitted(42, 27) Source(28, 24) + SourceIndex(0) name (Greeter)
+3 >Emitted(42, 28) Source(28, 25) + SourceIndex(0) name (Greeter)
+4 >Emitted(42, 30) Source(28, 27) + SourceIndex(0) name (Greeter)
+5 >Emitted(42, 31) Source(28, 28) + SourceIndex(0) name (Greeter)
---
>>> ], Greeter.prototype, "x");
1->^^^^^^^
@@ -496,9 +497,9 @@ sourceFile:sourceMapValidationDecorators.ts
> private
2 > x
3 > : string;
-1->Emitted(42, 8) Source(29, 13) + SourceIndex(0) name (Greeter)
-2 >Emitted(42, 30) Source(29, 14) + SourceIndex(0) name (Greeter)
-3 >Emitted(42, 32) Source(29, 23) + SourceIndex(0) name (Greeter)
+1->Emitted(43, 8) Source(29, 13) + SourceIndex(0) name (Greeter)
+2 >Emitted(43, 30) Source(29, 14) + SourceIndex(0) name (Greeter)
+3 >Emitted(43, 32) Source(29, 23) + SourceIndex(0) name (Greeter)
---
>>> Object.defineProperty(Greeter.prototype, "fn",
1->^^^^
@@ -513,9 +514,9 @@ sourceFile:sourceMapValidationDecorators.ts
>
2 > private
3 > fn
-1->Emitted(43, 5) Source(35, 5) + SourceIndex(0) name (Greeter)
-2 >Emitted(43, 27) Source(35, 13) + SourceIndex(0) name (Greeter)
-3 >Emitted(43, 50) Source(35, 15) + SourceIndex(0) name (Greeter)
+1->Emitted(44, 5) Source(35, 5) + SourceIndex(0) name (Greeter)
+2 >Emitted(44, 27) Source(35, 13) + SourceIndex(0) name (Greeter)
+3 >Emitted(44, 50) Source(35, 15) + SourceIndex(0) name (Greeter)
---
>>> __decorate([
>>> __param(0, ParameterDecorator1),
@@ -529,10 +530,10 @@ sourceFile:sourceMapValidationDecorators.ts
2 > @
3 > ParameterDecorator1
4 >
-1 >Emitted(45, 13) Source(36, 7) + SourceIndex(0) name (Greeter)
-2 >Emitted(45, 24) Source(36, 8) + SourceIndex(0) name (Greeter)
-3 >Emitted(45, 43) Source(36, 27) + SourceIndex(0) name (Greeter)
-4 >Emitted(45, 44) Source(36, 27) + SourceIndex(0) name (Greeter)
+1 >Emitted(46, 13) Source(36, 7) + SourceIndex(0) name (Greeter)
+2 >Emitted(46, 24) Source(36, 8) + SourceIndex(0) name (Greeter)
+3 >Emitted(46, 43) Source(36, 27) + SourceIndex(0) name (Greeter)
+4 >Emitted(46, 44) Source(36, 27) + SourceIndex(0) name (Greeter)
---
>>> __param(0, ParameterDecorator2(70))
1->^^^^^^^^^^^^
@@ -551,13 +552,13 @@ sourceFile:sourceMapValidationDecorators.ts
5 > 70
6 > )
7 >
-1->Emitted(46, 13) Source(37, 7) + SourceIndex(0) name (Greeter)
-2 >Emitted(46, 24) Source(37, 8) + SourceIndex(0) name (Greeter)
-3 >Emitted(46, 43) Source(37, 27) + SourceIndex(0) name (Greeter)
-4 >Emitted(46, 44) Source(37, 28) + SourceIndex(0) name (Greeter)
-5 >Emitted(46, 46) Source(37, 30) + SourceIndex(0) name (Greeter)
-6 >Emitted(46, 47) Source(37, 31) + SourceIndex(0) name (Greeter)
-7 >Emitted(46, 48) Source(37, 31) + SourceIndex(0) name (Greeter)
+1->Emitted(47, 13) Source(37, 7) + SourceIndex(0) name (Greeter)
+2 >Emitted(47, 24) Source(37, 8) + SourceIndex(0) name (Greeter)
+3 >Emitted(47, 43) Source(37, 27) + SourceIndex(0) name (Greeter)
+4 >Emitted(47, 44) Source(37, 28) + SourceIndex(0) name (Greeter)
+5 >Emitted(47, 46) Source(37, 30) + SourceIndex(0) name (Greeter)
+6 >Emitted(47, 47) Source(37, 31) + SourceIndex(0) name (Greeter)
+7 >Emitted(47, 48) Source(37, 31) + SourceIndex(0) name (Greeter)
---
>>> ], Greeter.prototype, "fn", Object.getOwnPropertyDescriptor(Greeter.prototype, "fn")));
1->^^^^^^^^^^^
@@ -575,11 +576,11 @@ sourceFile:sourceMapValidationDecorators.ts
> x: number) {
> return this.greeting;
> }
-1->Emitted(47, 12) Source(35, 13) + SourceIndex(0) name (Greeter)
-2 >Emitted(47, 35) Source(35, 15) + SourceIndex(0) name (Greeter)
-3 >Emitted(47, 69) Source(35, 13) + SourceIndex(0) name (Greeter)
-4 >Emitted(47, 92) Source(35, 15) + SourceIndex(0) name (Greeter)
-5 >Emitted(47, 96) Source(40, 6) + SourceIndex(0) name (Greeter)
+1->Emitted(48, 12) Source(35, 13) + SourceIndex(0) name (Greeter)
+2 >Emitted(48, 35) Source(35, 15) + SourceIndex(0) name (Greeter)
+3 >Emitted(48, 69) Source(35, 13) + SourceIndex(0) name (Greeter)
+4 >Emitted(48, 92) Source(35, 15) + SourceIndex(0) name (Greeter)
+5 >Emitted(48, 96) Source(40, 6) + SourceIndex(0) name (Greeter)
---
>>> Object.defineProperty(Greeter.prototype, "greetings",
1 >^^^^
@@ -592,9 +593,9 @@ sourceFile:sourceMapValidationDecorators.ts
> @PropertyDecorator2(80)
> get
3 > greetings
-1 >Emitted(48, 5) Source(42, 5) + SourceIndex(0) name (Greeter)
-2 >Emitted(48, 27) Source(44, 9) + SourceIndex(0) name (Greeter)
-3 >Emitted(48, 57) Source(44, 18) + SourceIndex(0) name (Greeter)
+1 >Emitted(49, 5) Source(42, 5) + SourceIndex(0) name (Greeter)
+2 >Emitted(49, 27) Source(44, 9) + SourceIndex(0) name (Greeter)
+3 >Emitted(49, 57) Source(44, 18) + SourceIndex(0) name (Greeter)
---
>>> __decorate([
>>> PropertyDecorator1,
@@ -603,8 +604,8 @@ sourceFile:sourceMapValidationDecorators.ts
3 > ^^^^^^->
1 >
2 > PropertyDecorator1
-1 >Emitted(50, 13) Source(42, 6) + SourceIndex(0) name (Greeter)
-2 >Emitted(50, 31) Source(42, 24) + SourceIndex(0) name (Greeter)
+1 >Emitted(51, 13) Source(42, 6) + SourceIndex(0) name (Greeter)
+2 >Emitted(51, 31) Source(42, 24) + SourceIndex(0) name (Greeter)
---
>>> PropertyDecorator2(80),
1->^^^^^^^^^^^^
@@ -619,11 +620,11 @@ sourceFile:sourceMapValidationDecorators.ts
3 > (
4 > 80
5 > )
-1->Emitted(51, 13) Source(43, 6) + SourceIndex(0) name (Greeter)
-2 >Emitted(51, 31) Source(43, 24) + SourceIndex(0) name (Greeter)
-3 >Emitted(51, 32) Source(43, 25) + SourceIndex(0) name (Greeter)
-4 >Emitted(51, 34) Source(43, 27) + SourceIndex(0) name (Greeter)
-5 >Emitted(51, 35) Source(43, 28) + SourceIndex(0) name (Greeter)
+1->Emitted(52, 13) Source(43, 6) + SourceIndex(0) name (Greeter)
+2 >Emitted(52, 31) Source(43, 24) + SourceIndex(0) name (Greeter)
+3 >Emitted(52, 32) Source(43, 25) + SourceIndex(0) name (Greeter)
+4 >Emitted(52, 34) Source(43, 27) + SourceIndex(0) name (Greeter)
+5 >Emitted(52, 35) Source(43, 28) + SourceIndex(0) name (Greeter)
---
>>> __param(0, ParameterDecorator1),
1->^^^^^^^^^^^^
@@ -641,10 +642,10 @@ sourceFile:sourceMapValidationDecorators.ts
2 > @
3 > ParameterDecorator1
4 >
-1->Emitted(52, 13) Source(49, 7) + SourceIndex(0) name (Greeter)
-2 >Emitted(52, 24) Source(49, 8) + SourceIndex(0) name (Greeter)
-3 >Emitted(52, 43) Source(49, 27) + SourceIndex(0) name (Greeter)
-4 >Emitted(52, 44) Source(49, 27) + SourceIndex(0) name (Greeter)
+1->Emitted(53, 13) Source(49, 7) + SourceIndex(0) name (Greeter)
+2 >Emitted(53, 24) Source(49, 8) + SourceIndex(0) name (Greeter)
+3 >Emitted(53, 43) Source(49, 27) + SourceIndex(0) name (Greeter)
+4 >Emitted(53, 44) Source(49, 27) + SourceIndex(0) name (Greeter)
---
>>> __param(0, ParameterDecorator2(90))
1->^^^^^^^^^^^^
@@ -663,13 +664,13 @@ sourceFile:sourceMapValidationDecorators.ts
5 > 90
6 > )
7 >
-1->Emitted(53, 13) Source(50, 7) + SourceIndex(0) name (Greeter)
-2 >Emitted(53, 24) Source(50, 8) + SourceIndex(0) name (Greeter)
-3 >Emitted(53, 43) Source(50, 27) + SourceIndex(0) name (Greeter)
-4 >Emitted(53, 44) Source(50, 28) + SourceIndex(0) name (Greeter)
-5 >Emitted(53, 46) Source(50, 30) + SourceIndex(0) name (Greeter)
-6 >Emitted(53, 47) Source(50, 31) + SourceIndex(0) name (Greeter)
-7 >Emitted(53, 48) Source(50, 31) + SourceIndex(0) name (Greeter)
+1->Emitted(54, 13) Source(50, 7) + SourceIndex(0) name (Greeter)
+2 >Emitted(54, 24) Source(50, 8) + SourceIndex(0) name (Greeter)
+3 >Emitted(54, 43) Source(50, 27) + SourceIndex(0) name (Greeter)
+4 >Emitted(54, 44) Source(50, 28) + SourceIndex(0) name (Greeter)
+5 >Emitted(54, 46) Source(50, 30) + SourceIndex(0) name (Greeter)
+6 >Emitted(54, 47) Source(50, 31) + SourceIndex(0) name (Greeter)
+7 >Emitted(54, 48) Source(50, 31) + SourceIndex(0) name (Greeter)
---
>>> ], Greeter.prototype, "greetings", Object.getOwnPropertyDescriptor(Greeter.prototype, "greetings")));
1->^^^^^^^^^^^
@@ -684,17 +685,17 @@ sourceFile:sourceMapValidationDecorators.ts
5 > () {
> return this.greeting;
> }
-1->Emitted(54, 12) Source(44, 9) + SourceIndex(0) name (Greeter)
-2 >Emitted(54, 42) Source(44, 18) + SourceIndex(0) name (Greeter)
-3 >Emitted(54, 76) Source(44, 9) + SourceIndex(0) name (Greeter)
-4 >Emitted(54, 106) Source(44, 18) + SourceIndex(0) name (Greeter)
-5 >Emitted(54, 110) Source(46, 6) + SourceIndex(0) name (Greeter)
+1->Emitted(55, 12) Source(44, 9) + SourceIndex(0) name (Greeter)
+2 >Emitted(55, 42) Source(44, 18) + SourceIndex(0) name (Greeter)
+3 >Emitted(55, 76) Source(44, 9) + SourceIndex(0) name (Greeter)
+4 >Emitted(55, 106) Source(44, 18) + SourceIndex(0) name (Greeter)
+5 >Emitted(55, 110) Source(46, 6) + SourceIndex(0) name (Greeter)
---
>>> __decorate([
1 >^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
-1 >Emitted(55, 5) Source(31, 5) + SourceIndex(0) name (Greeter)
+1 >Emitted(56, 5) Source(31, 5) + SourceIndex(0) name (Greeter)
---
>>> PropertyDecorator1,
1->^^^^^^^^
@@ -702,8 +703,8 @@ sourceFile:sourceMapValidationDecorators.ts
3 > ^^^^^->
1->@
2 > PropertyDecorator1
-1->Emitted(56, 9) Source(31, 6) + SourceIndex(0) name (Greeter)
-2 >Emitted(56, 27) Source(31, 24) + SourceIndex(0) name (Greeter)
+1->Emitted(57, 9) Source(31, 6) + SourceIndex(0) name (Greeter)
+2 >Emitted(57, 27) Source(31, 24) + SourceIndex(0) name (Greeter)
---
>>> PropertyDecorator2(60)
1->^^^^^^^^
@@ -717,11 +718,11 @@ sourceFile:sourceMapValidationDecorators.ts
3 > (
4 > 60
5 > )
-1->Emitted(57, 9) Source(32, 6) + SourceIndex(0) name (Greeter)
-2 >Emitted(57, 27) Source(32, 24) + SourceIndex(0) name (Greeter)
-3 >Emitted(57, 28) Source(32, 25) + SourceIndex(0) name (Greeter)
-4 >Emitted(57, 30) Source(32, 27) + SourceIndex(0) name (Greeter)
-5 >Emitted(57, 31) Source(32, 28) + SourceIndex(0) name (Greeter)
+1->Emitted(58, 9) Source(32, 6) + SourceIndex(0) name (Greeter)
+2 >Emitted(58, 27) Source(32, 24) + SourceIndex(0) name (Greeter)
+3 >Emitted(58, 28) Source(32, 25) + SourceIndex(0) name (Greeter)
+4 >Emitted(58, 30) Source(32, 27) + SourceIndex(0) name (Greeter)
+5 >Emitted(58, 31) Source(32, 28) + SourceIndex(0) name (Greeter)
---
>>> ], Greeter, "x1");
1 >^^^^^^^
@@ -732,15 +733,15 @@ sourceFile:sourceMapValidationDecorators.ts
> private static
2 > x1
3 > : number = 10;
-1 >Emitted(58, 8) Source(33, 20) + SourceIndex(0) name (Greeter)
-2 >Emitted(58, 21) Source(33, 22) + SourceIndex(0) name (Greeter)
-3 >Emitted(58, 23) Source(33, 36) + SourceIndex(0) name (Greeter)
+1 >Emitted(59, 8) Source(33, 20) + SourceIndex(0) name (Greeter)
+2 >Emitted(59, 21) Source(33, 22) + SourceIndex(0) name (Greeter)
+3 >Emitted(59, 23) Source(33, 36) + SourceIndex(0) name (Greeter)
---
>>> Greeter = __decorate([
1->^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^->
1->
-1->Emitted(59, 5) Source(8, 1) + SourceIndex(0) name (Greeter)
+1->Emitted(60, 5) Source(8, 1) + SourceIndex(0) name (Greeter)
---
>>> ClassDecorator1,
1->^^^^^^^^
@@ -748,8 +749,8 @@ sourceFile:sourceMapValidationDecorators.ts
3 > ^^^^^^->
1->@
2 > ClassDecorator1
-1->Emitted(60, 9) Source(8, 2) + SourceIndex(0) name (Greeter)
-2 >Emitted(60, 24) Source(8, 17) + SourceIndex(0) name (Greeter)
+1->Emitted(61, 9) Source(8, 2) + SourceIndex(0) name (Greeter)
+2 >Emitted(61, 24) Source(8, 17) + SourceIndex(0) name (Greeter)
---
>>> ClassDecorator2(10),
1->^^^^^^^^
@@ -764,11 +765,11 @@ sourceFile:sourceMapValidationDecorators.ts
3 > (
4 > 10
5 > )
-1->Emitted(61, 9) Source(9, 2) + SourceIndex(0) name (Greeter)
-2 >Emitted(61, 24) Source(9, 17) + SourceIndex(0) name (Greeter)
-3 >Emitted(61, 25) Source(9, 18) + SourceIndex(0) name (Greeter)
-4 >Emitted(61, 27) Source(9, 20) + SourceIndex(0) name (Greeter)
-5 >Emitted(61, 28) Source(9, 21) + SourceIndex(0) name (Greeter)
+1->Emitted(62, 9) Source(9, 2) + SourceIndex(0) name (Greeter)
+2 >Emitted(62, 24) Source(9, 17) + SourceIndex(0) name (Greeter)
+3 >Emitted(62, 25) Source(9, 18) + SourceIndex(0) name (Greeter)
+4 >Emitted(62, 27) Source(9, 20) + SourceIndex(0) name (Greeter)
+5 >Emitted(62, 28) Source(9, 21) + SourceIndex(0) name (Greeter)
---
>>> __param(0, ParameterDecorator1),
1->^^^^^^^^
@@ -783,10 +784,10 @@ sourceFile:sourceMapValidationDecorators.ts
2 > @
3 > ParameterDecorator1
4 >
-1->Emitted(62, 9) Source(12, 7) + SourceIndex(0) name (Greeter)
-2 >Emitted(62, 20) Source(12, 8) + SourceIndex(0) name (Greeter)
-3 >Emitted(62, 39) Source(12, 27) + SourceIndex(0) name (Greeter)
-4 >Emitted(62, 40) Source(12, 27) + SourceIndex(0) name (Greeter)
+1->Emitted(63, 9) Source(12, 7) + SourceIndex(0) name (Greeter)
+2 >Emitted(63, 20) Source(12, 8) + SourceIndex(0) name (Greeter)
+3 >Emitted(63, 39) Source(12, 27) + SourceIndex(0) name (Greeter)
+4 >Emitted(63, 40) Source(12, 27) + SourceIndex(0) name (Greeter)
---
>>> __param(0, ParameterDecorator2(20)),
1->^^^^^^^^
@@ -804,13 +805,13 @@ sourceFile:sourceMapValidationDecorators.ts
5 > 20
6 > )
7 >
-1->Emitted(63, 9) Source(13, 7) + SourceIndex(0) name (Greeter)
-2 >Emitted(63, 20) Source(13, 8) + SourceIndex(0) name (Greeter)
-3 >Emitted(63, 39) Source(13, 27) + SourceIndex(0) name (Greeter)
-4 >Emitted(63, 40) Source(13, 28) + SourceIndex(0) name (Greeter)
-5 >Emitted(63, 42) Source(13, 30) + SourceIndex(0) name (Greeter)
-6 >Emitted(63, 43) Source(13, 31) + SourceIndex(0) name (Greeter)
-7 >Emitted(63, 44) Source(13, 31) + SourceIndex(0) name (Greeter)
+1->Emitted(64, 9) Source(13, 7) + SourceIndex(0) name (Greeter)
+2 >Emitted(64, 20) Source(13, 8) + SourceIndex(0) name (Greeter)
+3 >Emitted(64, 39) Source(13, 27) + SourceIndex(0) name (Greeter)
+4 >Emitted(64, 40) Source(13, 28) + SourceIndex(0) name (Greeter)
+5 >Emitted(64, 42) Source(13, 30) + SourceIndex(0) name (Greeter)
+6 >Emitted(64, 43) Source(13, 31) + SourceIndex(0) name (Greeter)
+7 >Emitted(64, 44) Source(13, 31) + SourceIndex(0) name (Greeter)
---
>>> __param(1, ParameterDecorator1),
1 >^^^^^^^^
@@ -825,10 +826,10 @@ sourceFile:sourceMapValidationDecorators.ts
2 > @
3 > ParameterDecorator1
4 >
-1 >Emitted(64, 9) Source(16, 7) + SourceIndex(0) name (Greeter)
-2 >Emitted(64, 20) Source(16, 8) + SourceIndex(0) name (Greeter)
-3 >Emitted(64, 39) Source(16, 27) + SourceIndex(0) name (Greeter)
-4 >Emitted(64, 40) Source(16, 27) + SourceIndex(0) name (Greeter)
+1 >Emitted(65, 9) Source(16, 7) + SourceIndex(0) name (Greeter)
+2 >Emitted(65, 20) Source(16, 8) + SourceIndex(0) name (Greeter)
+3 >Emitted(65, 39) Source(16, 27) + SourceIndex(0) name (Greeter)
+4 >Emitted(65, 40) Source(16, 27) + SourceIndex(0) name (Greeter)
---
>>> __param(1, ParameterDecorator2(30))
1->^^^^^^^^
@@ -846,13 +847,13 @@ sourceFile:sourceMapValidationDecorators.ts
5 > 30
6 > )
7 >
-1->Emitted(65, 9) Source(17, 7) + SourceIndex(0) name (Greeter)
-2 >Emitted(65, 20) Source(17, 8) + SourceIndex(0) name (Greeter)
-3 >Emitted(65, 39) Source(17, 27) + SourceIndex(0) name (Greeter)
-4 >Emitted(65, 40) Source(17, 28) + SourceIndex(0) name (Greeter)
-5 >Emitted(65, 42) Source(17, 30) + SourceIndex(0) name (Greeter)
-6 >Emitted(65, 43) Source(17, 31) + SourceIndex(0) name (Greeter)
-7 >Emitted(65, 44) Source(17, 31) + SourceIndex(0) name (Greeter)
+1->Emitted(66, 9) Source(17, 7) + SourceIndex(0) name (Greeter)
+2 >Emitted(66, 20) Source(17, 8) + SourceIndex(0) name (Greeter)
+3 >Emitted(66, 39) Source(17, 27) + SourceIndex(0) name (Greeter)
+4 >Emitted(66, 40) Source(17, 28) + SourceIndex(0) name (Greeter)
+5 >Emitted(66, 42) Source(17, 30) + SourceIndex(0) name (Greeter)
+6 >Emitted(66, 43) Source(17, 31) + SourceIndex(0) name (Greeter)
+7 >Emitted(66, 44) Source(17, 31) + SourceIndex(0) name (Greeter)
---
>>> ], Greeter);
1 >^^^^^^^^^^^^^^^^
@@ -895,15 +896,15 @@ sourceFile:sourceMapValidationDecorators.ts
> this.greeting = greetings;
> }
>}
-1 >Emitted(66, 17) Source(54, 2) + SourceIndex(0) name (Greeter)
+1 >Emitted(67, 17) Source(54, 2) + SourceIndex(0) name (Greeter)
---
>>> return Greeter;
1->^^^^
2 > ^^^^^^^^^^^^^^
1->
2 > }
-1->Emitted(67, 5) Source(54, 1) + SourceIndex(0) name (Greeter)
-2 >Emitted(67, 19) Source(54, 2) + SourceIndex(0) name (Greeter)
+1->Emitted(68, 5) Source(54, 1) + SourceIndex(0) name (Greeter)
+2 >Emitted(68, 19) Source(54, 2) + SourceIndex(0) name (Greeter)
---
>>>})();
1 >
@@ -961,9 +962,9 @@ sourceFile:sourceMapValidationDecorators.ts
> this.greeting = greetings;
> }
> }
-1 >Emitted(68, 1) Source(54, 1) + SourceIndex(0) name (Greeter)
-2 >Emitted(68, 2) Source(54, 2) + SourceIndex(0) name (Greeter)
-3 >Emitted(68, 2) Source(8, 1) + SourceIndex(0)
-4 >Emitted(68, 6) Source(54, 2) + SourceIndex(0)
+1 >Emitted(69, 1) Source(54, 1) + SourceIndex(0) name (Greeter)
+2 >Emitted(69, 2) Source(54, 2) + SourceIndex(0) name (Greeter)
+3 >Emitted(69, 2) Source(8, 1) + SourceIndex(0)
+4 >Emitted(69, 6) Source(54, 2) + SourceIndex(0)
---
>>>//# sourceMappingURL=sourceMapValidationDecorators.js.map
\ No newline at end of file
diff --git a/tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts b/tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts
new file mode 100644
index 00000000000..231476ee339
--- /dev/null
+++ b/tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts
@@ -0,0 +1,10 @@
+// @target: es6
+module M {
+ export class C { }
+}
+module M {
+ {
+ let M = 0;
+ new C();
+ }
+}
\ No newline at end of file
diff --git a/tests/cases/project/rootDirectory.json b/tests/cases/project/rootDirectory.json
new file mode 100644
index 00000000000..6dad3982f93
--- /dev/null
+++ b/tests/cases/project/rootDirectory.json
@@ -0,0 +1,12 @@
+{
+ "scenario": "rootDirectory: specify rootDirectory",
+ "projectRoot": "tests/cases/projects/rootDirectory",
+ "inputFiles": [
+ "FolderA/FolderB/fileB.ts"
+ ],
+ "outDir": "outdir/simple",
+ "rootDir": "FolderA",
+ "sourceMap": true,
+ "declaration": true,
+ "baselineCheck": true
+}
\ No newline at end of file
diff --git a/tests/cases/project/rootDirectoryErrors.json b/tests/cases/project/rootDirectoryErrors.json
new file mode 100644
index 00000000000..18a256486d0
--- /dev/null
+++ b/tests/cases/project/rootDirectoryErrors.json
@@ -0,0 +1,11 @@
+{
+ "scenario": "rootDirectory: Files outside the rootDirectory",
+ "projectRoot": "tests/cases/projects/rootDirectory",
+ "inputFiles": [
+ "FolderA/FolderB/fileB.ts"
+ ],
+ "outDir": "outdir/simple",
+ "rootDir": "FolderA/FolderB/FolderC",
+ "declaration": true,
+ "baselineCheck": true
+}
\ No newline at end of file
diff --git a/tests/cases/project/rootDirectoryWithSourceRoot.json b/tests/cases/project/rootDirectoryWithSourceRoot.json
new file mode 100644
index 00000000000..227b55c13fd
--- /dev/null
+++ b/tests/cases/project/rootDirectoryWithSourceRoot.json
@@ -0,0 +1,12 @@
+{
+ "scenario": "rootDirectory: specify rootDirectory with sourceRoot",
+ "projectRoot": "tests/cases/projects/rootDirectory",
+ "inputFiles": [
+ "FolderA/FolderB/fileB.ts"
+ ],
+ "outDir": "outdir/simple",
+ "rootDir": "FolderA",
+ "sourceMap": true,
+ "sourceRoot": "SourceRootPath",
+ "baselineCheck": true
+}
\ No newline at end of file
diff --git a/tests/cases/projects/rootDirectory/FolderA/FolderB/FolderC/fileC.ts b/tests/cases/projects/rootDirectory/FolderA/FolderB/FolderC/fileC.ts
new file mode 100644
index 00000000000..f4885b3ca74
--- /dev/null
+++ b/tests/cases/projects/rootDirectory/FolderA/FolderB/FolderC/fileC.ts
@@ -0,0 +1,2 @@
+class C {
+}
diff --git a/tests/cases/projects/rootDirectory/FolderA/FolderB/fileB.ts b/tests/cases/projects/rootDirectory/FolderA/FolderB/fileB.ts
new file mode 100644
index 00000000000..03e0f4ad332
--- /dev/null
+++ b/tests/cases/projects/rootDirectory/FolderA/FolderB/fileB.ts
@@ -0,0 +1,4 @@
+///
+class B {
+ public c: C;
+}