mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Merge pull request #4371 from Microsoft/emitOutputForTsx
Emit tsx files correctly in getEmitOutput calls
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile1.js.map
|
||||
{"version":3,"file":"inputFile1.js","sourceRoot":"","sources":["inputFile1.ts"],"names":["Bar","Bar.constructor"],"mappings":"AAAA,kBAAkB;AACjB,IAAI,CAAC,GAAW,CAAC,CAAC;AAClB;IAAAA;IAGAC,CAACA;IAADD,UAACA;AAADA,CAACA,AAHD,IAGC"}FileName : tests/cases/fourslash/inputFile1.js
|
||||
// regular ts file
|
||||
var t = 5;
|
||||
var Bar = (function () {
|
||||
function Bar() {
|
||||
}
|
||||
return Bar;
|
||||
})();
|
||||
//# sourceMappingURL=inputFile1.js.mapFileName : tests/cases/fourslash/inputFile1.d.ts
|
||||
declare var t: number;
|
||||
declare class Bar {
|
||||
x: string;
|
||||
y: number;
|
||||
}
|
||||
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile2.jsx.map
|
||||
{"version":3,"file":"inputFile2.jsx","sourceRoot":"","sources":["inputFile2.tsx"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,QAAQ,CAAC;AACjB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC,CAAC,CAAC,EAAG,CAAA"}FileName : tests/cases/fourslash/inputFile2.jsx
|
||||
var y = "my div";
|
||||
var x = <div name={y}/>;
|
||||
//# sourceMappingURL=inputFile2.jsx.mapFileName : tests/cases/fourslash/inputFile2.d.ts
|
||||
declare var y: string;
|
||||
declare var x: any;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
EmitSkipped: false
|
||||
FileName : tests/cases/fourslash/inputFile1.js.map
|
||||
{"version":3,"file":"inputFile1.js","sourceRoot":"","sources":["inputFile1.ts"],"names":["Bar","Bar.constructor"],"mappings":"AAAA,kBAAkB;AACjB,IAAI,CAAC,GAAW,CAAC,CAAC;AAClB;IAAAA;IAGAC,CAACA;IAADD,UAACA;AAADA,CAACA,AAHD,IAGC"}FileName : tests/cases/fourslash/inputFile1.js
|
||||
// regular ts file
|
||||
var t = 5;
|
||||
var Bar = (function () {
|
||||
function Bar() {
|
||||
}
|
||||
return Bar;
|
||||
})();
|
||||
//# sourceMappingURL=inputFile1.js.mapFileName : tests/cases/fourslash/inputFile1.d.ts
|
||||
declare var t: number;
|
||||
declare class Bar {
|
||||
x: string;
|
||||
y: number;
|
||||
}
|
||||
|
||||
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
|
||||
var y = "my div";
|
||||
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;
|
||||
|
||||
22
tests/cases/fourslash/getEmitOutputTsxFile_Preserve.ts
Normal file
22
tests/cases/fourslash/getEmitOutputTsxFile_Preserve.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @BaselineFile: getEmitOutputTsxFile_Preserve.baseline
|
||||
// @declaration: true
|
||||
// @sourceMap: true
|
||||
// @jsx: preserve
|
||||
|
||||
// @Filename: inputFile1.ts
|
||||
// @emitThisFile: true
|
||||
////// regular ts file
|
||||
//// var t: number = 5;
|
||||
//// class Bar {
|
||||
//// x : string;
|
||||
//// y : number
|
||||
//// }
|
||||
|
||||
// @Filename: inputFile2.tsx
|
||||
// @emitThisFile: true
|
||||
//// var y = "my div";
|
||||
//// var x = <div name= {y} />
|
||||
|
||||
verify.baselineGetEmitOutput();
|
||||
22
tests/cases/fourslash/getEmitOutputTsxFile_React.ts
Normal file
22
tests/cases/fourslash/getEmitOutputTsxFile_React.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @BaselineFile: getEmitOutputTsxFile_React.baseline
|
||||
// @declaration: true
|
||||
// @sourceMap: true
|
||||
// @jsx: react
|
||||
|
||||
// @Filename: inputFile1.ts
|
||||
// @emitThisFile: true
|
||||
////// regular ts file
|
||||
//// var t: number = 5;
|
||||
//// class Bar {
|
||||
//// x : string;
|
||||
//// y : number
|
||||
//// }
|
||||
|
||||
// @Filename: inputFile2.tsx
|
||||
// @emitThisFile: true
|
||||
//// var y = "my div";
|
||||
//// var x = <div name= {y} />
|
||||
|
||||
verify.baselineGetEmitOutput();
|
||||
Reference in New Issue
Block a user