Merge branch 'master' into compute-common-source-dir

This commit is contained in:
Wesley Wigham
2015-11-12 15:59:11 -08:00
47 changed files with 579 additions and 29 deletions
+19 -4
View File
@@ -8,6 +8,7 @@ TypeScript is authored by:
* Basarat Ali Syed
* Ben Duffield
* Bill Ticehurst
* Brett Mayen
* Bryan Forbes
* Caitlin Potter
* Chris Bubernak
@@ -17,11 +18,14 @@ TypeScript is authored by:
* Dan Quirk
* Daniel Rosenwasser
* David Li
* Dick van den Brink
* Dirk Bäumer
* Denis Nedelyaev
* Dick van den Brink
* Dirk Bäumer
* Eyas Sharaiha
* Frank Wallis
* Gabriel Isenberg
* Gilad Peleg
* Graeme Wicksted
* Guillaume Salles
* Harald Niesche
* Ingvar Stepanyan
@@ -31,30 +35,39 @@ TypeScript is authored by:
* Jason Ramsay
* Jed Mao
* Johannes Rieken
* John Vilk
* Jonathan Bond-Caron
* Jonathan Park
* Jonathan Turner
* Josh Kalderimis
* Julian Williams
* Kagami Sascha Rosylight
* Keith Mashinter
* Ken Howard
* Kenji Imamula
* Lorant Pinter
* Martin Všetička
* Masahiro Wakame
* Max Deepfield
* Micah Zoltu
* Mohamed Hegazy
* Nathan Shively-Sanders
* Oleg Mihailik
* Oleksandr Chekhovskyi
* Paul van Brenk
* Pedro Maltez
* Philip Bulley
* piloopin
* @progre
* Punya Biswal
* Ron Buckton
* Ryan Cavanaugh
* Ryohei Ikegami
* Sébastien Arod
* Sheetal Nandi
* Shengping Zhong
* Shyyko Serhiy
* Simon Hürlimann
* Simon Hürlimann
* Solal Pirelli
* Stan Thomas
* Steve Lucco
@@ -63,8 +76,10 @@ TypeScript is authored by:
* togru
* Tomas Grubliauskas
* TruongSinh Tran-Nguyen
* Viliv Vane
* Vladimir Matveev
* Wesley Wigham
* York Yao
* Yui Tanglertsampan
* Zev Spitz
* Zhengbo Li
* Zhengbo Li
+2 -2
View File
@@ -1,6 +1,6 @@
[![Build Status](https://travis-ci.org/Microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/Microsoft/TypeScript)
[![npm version](https://badge.fury.io/js/typescript.svg)](http://badge.fury.io/js/typescript)
[![Downloads](http://img.shields.io/npm/dm/TypeScript.svg)](https://npmjs.org/package/typescript)
[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
[![Downloads](https://img.shields.io/npm/dm/TypeScript.svg)](https://www.npmjs.com/package/typescript)
# TypeScript
+6 -6
View File
@@ -12886,13 +12886,13 @@ namespace ts {
// In a 'switch' statement, each 'case' expression must be of a type that is assignable to or from the type of the 'switch' expression.
const caseType = checkExpression(caseClause.expression);
// Permit 'number[] | "foo"' to be asserted to 'string'.
if (expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, TypeFlags.StringLike)) {
return;
}
const expressionTypeIsAssignableToCaseType =
// Permit 'number[] | "foo"' to be asserted to 'string'.
(expressionTypeIsStringLike && someConstituentTypeHasKind(caseType, TypeFlags.StringLike)) ||
isTypeAssignableTo(expressionType, caseType);
if (!isTypeAssignableTo(expressionType, caseType)) {
// check 'expressionType isAssignableTo caseType' failed, try the reversed check and report errors if it fails
if (!expressionTypeIsAssignableToCaseType) {
// 'expressionType is not assignable to caseType', try the reversed check and report errors if it fails
checkTypeAssignableTo(caseType, expressionType, caseClause.expression, /*headMessage*/ undefined);
}
}
+3 -3
View File
@@ -1592,13 +1592,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
/// these emit into an object literal property name, we don't need to be worried
/// about keywords, just non-identifier characters
function emitAttributeName(name: Identifier) {
if (/[A-Za-z_]+[\w*]/.test(name.text)) {
write("\"");
if (/^[A-Za-z_]\w*$/.test(name.text)) {
emit(name);
write("\"");
}
else {
write("\"");
emit(name);
write("\"");
}
}
+4 -6
View File
@@ -997,16 +997,15 @@ namespace ts {
if (options.mapRoot) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap"));
}
if (options.sourceRoot) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceRoot", "inlineSourceMap"));
}
}
if (options.inlineSources) {
if (!options.sourceMap && !options.inlineSourceMap) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided));
}
if (options.sourceRoot) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceRoot", "inlineSources"));
}
}
if (options.out && options.outFile) {
@@ -1018,10 +1017,9 @@ namespace ts {
if (options.mapRoot) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "mapRoot", "sourceMap"));
}
if (options.sourceRoot) {
if (options.sourceRoot && !options.inlineSourceMap) {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "sourceRoot", "sourceMap"));
}
return;
}
const languageVersion = options.target || ScriptTarget.ES3;
+4 -1
View File
@@ -2847,8 +2847,11 @@ namespace ts {
}
function sourceFileUpToDate(sourceFile: SourceFile): boolean {
if (!sourceFile) {
return false;
}
let path = sourceFile.path || toPath(sourceFile.fileName, currentDirectory, getCanonicalFileName);
return sourceFile && sourceFile.version === hostCache.getVersion(path);
return sourceFile.version === hostCache.getVersion(path);
}
function programUpToDate(): boolean {
@@ -0,0 +1,27 @@
//// [checkSwitchStatementIfCaseTypeIsString.ts]
declare function use(a: any): void;
class A {
doIt(x: Array<string>): void {
x.forEach((v) => {
switch(v) {
case "test": use(this);
}
});
}
}
//// [checkSwitchStatementIfCaseTypeIsString.js]
var A = (function () {
function A() {
}
A.prototype.doIt = function (x) {
var _this = this;
x.forEach(function (v) {
switch (v) {
case "test": use(_this);
}
});
};
return A;
})();
@@ -0,0 +1,29 @@
=== tests/cases/compiler/checkSwitchStatementIfCaseTypeIsString.ts ===
declare function use(a: any): void;
>use : Symbol(use, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 0, 0))
>a : Symbol(a, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 0, 21))
class A {
>A : Symbol(A, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 0, 35))
doIt(x: Array<string>): void {
>doIt : Symbol(doIt, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 2, 9))
>x : Symbol(x, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 3, 9))
>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
x.forEach((v) => {
>x.forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --))
>x : Symbol(x, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 3, 9))
>forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --))
>v : Symbol(v, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 4, 19))
switch(v) {
>v : Symbol(v, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 4, 19))
case "test": use(this);
>use : Symbol(use, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 0, 0))
>this : Symbol(A, Decl(checkSwitchStatementIfCaseTypeIsString.ts, 0, 35))
}
});
}
}
@@ -0,0 +1,33 @@
=== tests/cases/compiler/checkSwitchStatementIfCaseTypeIsString.ts ===
declare function use(a: any): void;
>use : (a: any) => void
>a : any
class A {
>A : A
doIt(x: Array<string>): void {
>doIt : (x: string[]) => void
>x : string[]
>Array : T[]
x.forEach((v) => {
>x.forEach((v) => { switch(v) { case "test": use(this); } }) : void
>x.forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void
>x : string[]
>forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void
>(v) => { switch(v) { case "test": use(this); } } : (v: string) => void
>v : string
switch(v) {
>v : string
case "test": use(this);
>"test" : string
>use(this) : void
>use : (a: any) => void
>this : this
}
});
}
}
@@ -17,9 +17,9 @@ declare class Bar {
EmitSkipped: false
FileName : tests/cases/fourslash/inputFile2.js.map
{"version":3,"file":"inputFile2.js","sourceRoot":"","sources":["inputFile2.tsx"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,QAAQ,CAAC;AACjB,IAAI,CAAC,GAAG,qBAAC,GAAG,KAAC,IAAI,GAAG,CAAE,EAAG,CAAA"}FileName : tests/cases/fourslash/inputFile2.js
{"version":3,"file":"inputFile2.js","sourceRoot":"","sources":["inputFile2.tsx"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,QAAQ,CAAC;AACjB,IAAI,CAAC,GAAG,qBAAC,GAAG,IAAC,IAAI,EAAG,CAAE,EAAG,CAAA"}FileName : tests/cases/fourslash/inputFile2.js
var y = "my div";
var x = React.createElement("div", {"name": y});
var x = React.createElement("div", {name: y});
//# sourceMappingURL=inputFile2.js.mapFileName : tests/cases/fourslash/inputFile2.d.ts
declare var y: string;
declare var x: any;
@@ -1,12 +1,10 @@
error TS5053: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'.
error TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'.
error TS5053: Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'.
tests/cases/compiler/inlineSourceMap2.ts(5,1): error TS2304: Cannot find name 'console'.
!!! error TS5053: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'.
!!! error TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'.
!!! error TS5053: Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'.
==== tests/cases/compiler/inlineSourceMap2.ts (1 errors) ====
// configuration errors
@@ -9,6 +9,6 @@ declare var React: any;
//// [keywordInJsxIdentifier.js]
React.createElement("foo", {"class-id": true});
React.createElement("foo", {"class": true});
React.createElement("foo", {class: true});
React.createElement("foo", {"class-id": "1"});
React.createElement("foo", {"class": "1"});
React.createElement("foo", {class: "1"});
@@ -0,0 +1,9 @@
error TS5052: Option 'mapRoot' cannot be specified without specifying option 'sourceMap'.
error TS5053: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'.
!!! error TS5052: Option 'mapRoot' cannot be specified without specifying option 'sourceMap'.
!!! error TS5053: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'.
==== tests/cases/compiler/optionsInlineSourceMapMapRoot.ts (0 errors) ====
var a = 10;
@@ -0,0 +1,7 @@
//// [optionsInlineSourceMapMapRoot.ts]
var a = 10;
//// [optionsInlineSourceMapMapRoot.js]
var a = 10;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcE1hcFJvb3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9vcHRpb25zSW5saW5lU291cmNlTWFwTWFwUm9vdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUMifQ==
@@ -0,0 +1,33 @@
===================================================================
JsFile: optionsInlineSourceMapMapRoot.js
mapUrl: local/optionsInlineSourceMapMapRoot.js.map
sourceRoot:
sources: ../optionsInlineSourceMapMapRoot.ts
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/compiler/optionsInlineSourceMapMapRoot.js
sourceFile:../optionsInlineSourceMapMapRoot.ts
-------------------------------------------------------------------
>>>var a = 10;
1 >
2 >^^^^
3 > ^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >var
3 > a
4 > =
5 > 10
6 > ;
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0)
3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0)
4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0)
5 >Emitted(1, 11) Source(2, 11) + SourceIndex(0)
6 >Emitted(1, 12) Source(2, 12) + SourceIndex(0)
---
>>>//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcE1hcFJvb3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9vcHRpb25zSW5saW5lU291cmNlTWFwTWFwUm9vdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUMifQ==
@@ -0,0 +1,7 @@
//// [optionsInlineSourceMapSourceRoot.ts]
var a = 10;
//// [optionsInlineSourceMapSourceRoot.js]
var a = 10;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcFNvdXJjZVJvb3QuanMiLCJzb3VyY2VSb290IjoibG9jYWwvIiwic291cmNlcyI6WyJvcHRpb25zSW5saW5lU291cmNlTWFwU291cmNlUm9vdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUMifQ==
@@ -0,0 +1,33 @@
===================================================================
JsFile: optionsInlineSourceMapSourceRoot.js
mapUrl: optionsInlineSourceMapSourceRoot.js.map
sourceRoot: local/
sources: optionsInlineSourceMapSourceRoot.ts
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/compiler/optionsInlineSourceMapSourceRoot.js
sourceFile:optionsInlineSourceMapSourceRoot.ts
-------------------------------------------------------------------
>>>var a = 10;
1 >
2 >^^^^
3 > ^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >var
3 > a
4 > =
5 > 10
6 > ;
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0)
3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0)
4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0)
5 >Emitted(1, 11) Source(2, 11) + SourceIndex(0)
6 >Emitted(1, 12) Source(2, 12) + SourceIndex(0)
---
>>>//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcFNvdXJjZVJvb3QuanMiLCJzb3VyY2VSb290IjoibG9jYWwvIiwic291cmNlcyI6WyJvcHRpb25zSW5saW5lU291cmNlTWFwU291cmNlUm9vdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUMifQ==
@@ -0,0 +1,5 @@
=== tests/cases/compiler/optionsInlineSourceMapSourceRoot.ts ===
var a = 10;
>a : Symbol(a, Decl(optionsInlineSourceMapSourceRoot.ts, 1, 3))
@@ -0,0 +1,6 @@
=== tests/cases/compiler/optionsInlineSourceMapSourceRoot.ts ===
var a = 10;
>a : number
>10 : number
@@ -0,0 +1,7 @@
error TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'.
!!! error TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'.
==== tests/cases/compiler/optionsInlineSourceMapSourcemap.ts (0 errors) ====
var a = 10;
@@ -0,0 +1,7 @@
//// [optionsInlineSourceMapSourcemap.ts]
var a = 10;
//// [optionsInlineSourceMapSourcemap.js]
var a = 10;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcFNvdXJjZW1hcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIm9wdGlvbnNJbmxpbmVTb3VyY2VNYXBTb3VyY2VtYXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFDIn0=
@@ -0,0 +1,33 @@
===================================================================
JsFile: optionsInlineSourceMapSourcemap.js
mapUrl: optionsInlineSourceMapSourcemap.js.map
sourceRoot:
sources: optionsInlineSourceMapSourcemap.ts
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/compiler/optionsInlineSourceMapSourcemap.js
sourceFile:optionsInlineSourceMapSourcemap.ts
-------------------------------------------------------------------
>>>var a = 10;
1 >
2 >^^^^
3 > ^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >var
3 > a
4 > =
5 > 10
6 > ;
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0)
3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0)
4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0)
5 >Emitted(1, 11) Source(2, 11) + SourceIndex(0)
6 >Emitted(1, 12) Source(2, 12) + SourceIndex(0)
---
>>>//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcFNvdXJjZW1hcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIm9wdGlvbnNJbmxpbmVTb3VyY2VNYXBTb3VyY2VtYXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFDIn0=
@@ -0,0 +1,7 @@
//// [optionsSourcemapInlineSources.ts]
var a = 10;
//// [optionsSourcemapInlineSources.js]
var a = 10;
//# sourceMappingURL=optionsSourcemapInlineSources.js.map
@@ -0,0 +1,2 @@
//// [optionsSourcemapInlineSources.js.map]
{"version":3,"file":"optionsSourcemapInlineSources.js","sourceRoot":"","sources":["optionsSourcemapInlineSources.ts"],"names":[],"mappings":"AACA,IAAI,CAAC,GAAG,EAAE,CAAC","sourcesContent":["\nvar a = 10;"]}
@@ -0,0 +1,34 @@
===================================================================
JsFile: optionsSourcemapInlineSources.js
mapUrl: optionsSourcemapInlineSources.js.map
sourceRoot:
sources: optionsSourcemapInlineSources.ts
sourcesContent: ["\nvar a = 10;"]
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/compiler/optionsSourcemapInlineSources.js
sourceFile:optionsSourcemapInlineSources.ts
-------------------------------------------------------------------
>>>var a = 10;
1 >
2 >^^^^
3 > ^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >var
3 > a
4 > =
5 > 10
6 > ;
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0)
3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0)
4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0)
5 >Emitted(1, 11) Source(2, 11) + SourceIndex(0)
6 >Emitted(1, 12) Source(2, 12) + SourceIndex(0)
---
>>>//# sourceMappingURL=optionsSourcemapInlineSources.js.map
@@ -0,0 +1,5 @@
=== tests/cases/compiler/optionsSourcemapInlineSources.ts ===
var a = 10;
>a : Symbol(a, Decl(optionsSourcemapInlineSources.ts, 1, 3))
@@ -0,0 +1,6 @@
=== tests/cases/compiler/optionsSourcemapInlineSources.ts ===
var a = 10;
>a : number
>10 : number
@@ -0,0 +1,7 @@
//// [optionsSourcemapInlineSourcesMapRoot.ts]
var a = 10;
//// [optionsSourcemapInlineSourcesMapRoot.js]
var a = 10;
//# sourceMappingURL=local/optionsSourcemapInlineSourcesMapRoot.js.map
@@ -0,0 +1,2 @@
//// [optionsSourcemapInlineSourcesMapRoot.js.map]
{"version":3,"file":"optionsSourcemapInlineSourcesMapRoot.js","sourceRoot":"","sources":["../optionsSourcemapInlineSourcesMapRoot.ts"],"names":[],"mappings":"AACA,IAAI,CAAC,GAAG,EAAE,CAAC","sourcesContent":["\nvar a = 10;"]}
@@ -0,0 +1,34 @@
===================================================================
JsFile: optionsSourcemapInlineSourcesMapRoot.js
mapUrl: local/optionsSourcemapInlineSourcesMapRoot.js.map
sourceRoot:
sources: ../optionsSourcemapInlineSourcesMapRoot.ts
sourcesContent: ["\nvar a = 10;"]
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/compiler/optionsSourcemapInlineSourcesMapRoot.js
sourceFile:../optionsSourcemapInlineSourcesMapRoot.ts
-------------------------------------------------------------------
>>>var a = 10;
1 >
2 >^^^^
3 > ^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >var
3 > a
4 > =
5 > 10
6 > ;
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0)
3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0)
4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0)
5 >Emitted(1, 11) Source(2, 11) + SourceIndex(0)
6 >Emitted(1, 12) Source(2, 12) + SourceIndex(0)
---
>>>//# sourceMappingURL=local/optionsSourcemapInlineSourcesMapRoot.js.map
@@ -0,0 +1,5 @@
=== tests/cases/compiler/optionsSourcemapInlineSourcesMapRoot.ts ===
var a = 10;
>a : Symbol(a, Decl(optionsSourcemapInlineSourcesMapRoot.ts, 1, 3))
@@ -0,0 +1,6 @@
=== tests/cases/compiler/optionsSourcemapInlineSourcesMapRoot.ts ===
var a = 10;
>a : number
>10 : number
@@ -0,0 +1,7 @@
error TS5053: Option 'sourceRoot' cannot be specified with option 'inlineSources'.
!!! error TS5053: Option 'sourceRoot' cannot be specified with option 'inlineSources'.
==== tests/cases/compiler/optionsSourcemapInlineSourcesSourceRoot.ts (0 errors) ====
var a = 10;
@@ -0,0 +1,7 @@
//// [optionsSourcemapInlineSourcesSourceRoot.ts]
var a = 10;
//// [optionsSourcemapInlineSourcesSourceRoot.js]
var a = 10;
//# sourceMappingURL=optionsSourcemapInlineSourcesSourceRoot.js.map
@@ -0,0 +1,2 @@
//// [optionsSourcemapInlineSourcesSourceRoot.js.map]
{"version":3,"file":"optionsSourcemapInlineSourcesSourceRoot.js","sourceRoot":"local/","sources":["optionsSourcemapInlineSourcesSourceRoot.ts"],"names":[],"mappings":"AACA,IAAI,CAAC,GAAG,EAAE,CAAC","sourcesContent":["\nvar a = 10;"]}
@@ -0,0 +1,34 @@
===================================================================
JsFile: optionsSourcemapInlineSourcesSourceRoot.js
mapUrl: optionsSourcemapInlineSourcesSourceRoot.js.map
sourceRoot: local/
sources: optionsSourcemapInlineSourcesSourceRoot.ts
sourcesContent: ["\nvar a = 10;"]
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/compiler/optionsSourcemapInlineSourcesSourceRoot.js
sourceFile:optionsSourcemapInlineSourcesSourceRoot.ts
-------------------------------------------------------------------
>>>var a = 10;
1 >
2 >^^^^
3 > ^
4 > ^^^
5 > ^^
6 > ^
7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >var
3 > a
4 > =
5 > 10
6 > ;
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0)
3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0)
4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0)
5 >Emitted(1, 11) Source(2, 11) + SourceIndex(0)
6 >Emitted(1, 12) Source(2, 12) + SourceIndex(0)
---
>>>//# sourceMappingURL=optionsSourcemapInlineSourcesSourceRoot.js.map
@@ -20,6 +20,6 @@ declare var Foo, React;
//// [app.js]
var mod_1 = require('mod');
// Should see mod_1['default'] in emit here
React.createElement(Foo, {"handler": mod_1["default"]});
React.createElement(Foo, {handler: mod_1["default"]});
// Should see mod_1['default'] in emit here
React.createElement(Foo, React.__spread({}, mod_1["default"]));
@@ -0,0 +1,50 @@
tests/cases/conformance/jsx/tsxReactEmit7.tsx(9,10): error TS2304: Cannot find name 'React'.
tests/cases/conformance/jsx/tsxReactEmit7.tsx(10,10): error TS2304: Cannot find name 'React'.
tests/cases/conformance/jsx/tsxReactEmit7.tsx(11,10): error TS2304: Cannot find name 'React'.
tests/cases/conformance/jsx/tsxReactEmit7.tsx(12,10): error TS2304: Cannot find name 'React'.
tests/cases/conformance/jsx/tsxReactEmit7.tsx(15,10): error TS2304: Cannot find name 'React'.
tests/cases/conformance/jsx/tsxReactEmit7.tsx(16,10): error TS2304: Cannot find name 'React'.
tests/cases/conformance/jsx/tsxReactEmit7.tsx(17,10): error TS2304: Cannot find name 'React'.
tests/cases/conformance/jsx/tsxReactEmit7.tsx(18,10): error TS2304: Cannot find name 'React'.
tests/cases/conformance/jsx/tsxReactEmit7.tsx(19,10): error TS2304: Cannot find name 'React'.
==== tests/cases/conformance/jsx/tsxReactEmit7.tsx (9 errors) ====
declare module JSX {
interface Element { }
interface IntrinsicElements {
[s: string]: any;
}
}
var m = <div x-y="val"></div>;
~~~
!!! error TS2304: Cannot find name 'React'.
var n = <div xx-y="val"></div>;
~~~
!!! error TS2304: Cannot find name 'React'.
var o = <div x-yy="val"></div>;
~~~
!!! error TS2304: Cannot find name 'React'.
var p = <div xx-yy="val"></div>;
~~~
!!! error TS2304: Cannot find name 'React'.
// Investigation
var a = <div x="val"></div>;
~~~
!!! error TS2304: Cannot find name 'React'.
var b = <div xx="val"></div>;
~~~
!!! error TS2304: Cannot find name 'React'.
var c = <div xxx="val"></div>;
~~~
!!! error TS2304: Cannot find name 'React'.
var d = <div xxxx="val"></div>;
~~~
!!! error TS2304: Cannot find name 'React'.
var e = <div xxxxx="val"></div>;
~~~
!!! error TS2304: Cannot find name 'React'.
@@ -0,0 +1,33 @@
//// [tsxReactEmit7.tsx]
declare module JSX {
interface Element { }
interface IntrinsicElements {
[s: string]: any;
}
}
var m = <div x-y="val"></div>;
var n = <div xx-y="val"></div>;
var o = <div x-yy="val"></div>;
var p = <div xx-yy="val"></div>;
// Investigation
var a = <div x="val"></div>;
var b = <div xx="val"></div>;
var c = <div xxx="val"></div>;
var d = <div xxxx="val"></div>;
var e = <div xxxxx="val"></div>;
//// [tsxReactEmit7.js]
var m = React.createElement("div", {"x-y": "val"});
var n = React.createElement("div", {"xx-y": "val"});
var o = React.createElement("div", {"x-yy": "val"});
var p = React.createElement("div", {"xx-yy": "val"});
// Investigation
var a = React.createElement("div", {x: "val"});
var b = React.createElement("div", {xx: "val"});
var c = React.createElement("div", {xxx: "val"});
var d = React.createElement("div", {xxxx: "val"});
var e = React.createElement("div", {xxxxx: "val"});
@@ -0,0 +1,11 @@
declare function use(a: any): void;
class A {
doIt(x: Array<string>): void {
x.forEach((v) => {
switch(v) {
case "test": use(this);
}
});
}
}
@@ -0,0 +1,4 @@
// @mapRoot: local
// @inlineSourceMap: true
var a = 10;
@@ -0,0 +1,4 @@
// @sourceRoot: local
// @inlineSourceMap: true
var a = 10;
@@ -0,0 +1,4 @@
// @sourcemap: true
// @inlineSourceMap: true
var a = 10;
@@ -0,0 +1,4 @@
// @sourcemap: true
// @inlineSources: true
var a = 10;
@@ -0,0 +1,5 @@
// @sourcemap: true
// @inlineSources: true
// @mapRoot: local
var a = 10;
@@ -0,0 +1,5 @@
// @sourcemap: true
// @inlineSources: true
// @sourceRoot: local
var a = 10;
@@ -0,0 +1,22 @@
//@jsx: react
//@module: commonjs
//@filename: file.tsx
declare module JSX {
interface Element { }
interface IntrinsicElements {
[s: string]: any;
}
}
var m = <div x-y="val"></div>;
var n = <div xx-y="val"></div>;
var o = <div x-yy="val"></div>;
var p = <div xx-yy="val"></div>;
// Investigation
var a = <div x="val"></div>;
var b = <div xx="val"></div>;
var c = <div xxx="val"></div>;
var d = <div xxxx="val"></div>;
var e = <div xxxxx="val"></div>;