diff --git a/tests/baselines/reference/jsxFactoryIdentifier.js b/tests/baselines/reference/jsxFactoryIdentifier.js index 8205e752abd..82c8f6410e6 100644 --- a/tests/baselines/reference/jsxFactoryIdentifier.js +++ b/tests/baselines/reference/jsxFactoryIdentifier.js @@ -67,7 +67,7 @@ exports.createElement = Element.createElement; function toCamelCase(text) { return text[0].toLowerCase() + text.substring(1); } -//// [test.js] +//# sourceMappingURL=Element.js.map//// [test.js] "use strict"; const Element_1 = require("./Element"); let createElement = Element_1.Element.createElement; @@ -80,3 +80,4 @@ class A { ]; } } +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/jsxFactoryIdentifier.js.map b/tests/baselines/reference/jsxFactoryIdentifier.js.map new file mode 100644 index 00000000000..cad196b8ba5 --- /dev/null +++ b/tests/baselines/reference/jsxFactoryIdentifier.js.map @@ -0,0 +1,3 @@ +//// [Element.js.map] +{"version":3,"file":"Element.js","sourceRoot":"","sources":["Element.ts"],"names":[],"mappings":";AAaA,IAAiB,OAAO,CAUvB;AAVD,WAAiB,OAAO;IACpB,mBAA0B,EAAO;QAC7B,MAAM,CAAC,EAAE,CAAC,wBAAwB,KAAK,SAAS,CAAC;IACrD,CAAC;IAFe,iBAAS,YAExB,CAAA;IAED,uBAA8B,IAAW;QAErC,MAAM,CAAC,EACN,CAAA;IACL,CAAC;IAJe,qBAAa,gBAI5B,CAAA;AACL,CAAC,EAVgB,OAAO,GAAP,eAAO,KAAP,eAAO,QAUvB;AAEU,QAAA,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;AAEjD,qBAAqB,IAAY;IAC7B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC"}//// [test.js.map] +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";AAAA,uCAAmC;AACnC,IAAI,aAAa,GAAG,iBAAO,CAAC,aAAa,CAAC;AAC1C,IAAI,CAIH,CAAC;AAEF;IACC,IAAI;QACH,MAAM,CAAC;YACN,wBAAM,OAAO,EAAC,YAAY,GAAQ;YAClC,wBAAM,OAAO,EAAE,CAAC,CAAC,CAAE,CAAC,CAAC,GAAS;SAC9B,CAAC;IACH,CAAC;CACD"} \ No newline at end of file diff --git a/tests/baselines/reference/jsxFactoryIdentifier.sourcemap.txt b/tests/baselines/reference/jsxFactoryIdentifier.sourcemap.txt new file mode 100644 index 00000000000..a4ddc8c050b --- /dev/null +++ b/tests/baselines/reference/jsxFactoryIdentifier.sourcemap.txt @@ -0,0 +1,520 @@ +=================================================================== +JsFile: Element.js +mapUrl: Element.js.map +sourceRoot: +sources: Element.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/Element.js +sourceFile:Element.ts +------------------------------------------------------------------- +>>>"use strict"; +>>>var Element; +1 > +2 >^^^^ +3 > ^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^-> +1 > + >declare namespace JSX { + > interface Element { + > name: string; + > isIntrinsic: boolean; + > isCustomElement: boolean; + > toString(renderId?: number): string; + > bindDOM(renderId?: number): number; + > resetComponent(): void; + > instantiateComponents(renderId?: number): number; + > props: any; + > } + >} + > +2 >export namespace +3 > Element +4 > { + > export function isElement(el: any): el is JSX.Element { + > return el.markAsChildOfRootElement !== undefined; + > } + > + > export function createElement(args: any[]) { + > + > return { + > } + > } + > } +1 >Emitted(2, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(14, 18) + SourceIndex(0) +3 >Emitted(2, 12) Source(14, 25) + SourceIndex(0) +4 >Emitted(2, 13) Source(24, 2) + SourceIndex(0) +--- +>>>(function (Element) { +1-> +2 >^^^^^^^^^^^ +3 > ^^^^^^^ +4 > ^^^^^^^^^^^-> +1-> +2 >export namespace +3 > Element +1->Emitted(3, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(3, 12) Source(14, 18) + SourceIndex(0) +3 >Emitted(3, 19) Source(14, 25) + SourceIndex(0) +--- +>>> function isElement(el) { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> { + > +2 > export function isElement( +3 > el: any +1->Emitted(4, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(4, 24) Source(15, 31) + SourceIndex(0) +3 >Emitted(4, 26) Source(15, 38) + SourceIndex(0) +--- +>>> return el.markAsChildOfRootElement !== undefined; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^ +1->): el is JSX.Element { + > +2 > return +3 > +4 > el +5 > . +6 > markAsChildOfRootElement +7 > !== +8 > undefined +9 > ; +1->Emitted(5, 9) Source(16, 9) + SourceIndex(0) +2 >Emitted(5, 15) Source(16, 15) + SourceIndex(0) +3 >Emitted(5, 16) Source(16, 16) + SourceIndex(0) +4 >Emitted(5, 18) Source(16, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(16, 19) + SourceIndex(0) +6 >Emitted(5, 43) Source(16, 43) + SourceIndex(0) +7 >Emitted(5, 48) Source(16, 48) + SourceIndex(0) +8 >Emitted(5, 57) Source(16, 57) + SourceIndex(0) +9 >Emitted(5, 58) Source(16, 58) + SourceIndex(0) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(6, 5) Source(17, 5) + SourceIndex(0) +2 >Emitted(6, 6) Source(17, 6) + SourceIndex(0) +--- +>>> Element.isElement = isElement; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^ +4 > ^ +5 > ^-> +1-> +2 > isElement +3 > (el: any): el is JSX.Element { + > return el.markAsChildOfRootElement !== undefined; + > } +4 > +1->Emitted(7, 5) Source(15, 21) + SourceIndex(0) +2 >Emitted(7, 22) Source(15, 30) + SourceIndex(0) +3 >Emitted(7, 34) Source(17, 6) + SourceIndex(0) +4 >Emitted(7, 35) Source(17, 6) + SourceIndex(0) +--- +>>> function createElement(args) { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^ +1-> + > + > +2 > export function createElement( +3 > args: any[] +1->Emitted(8, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(8, 28) Source(19, 35) + SourceIndex(0) +3 >Emitted(8, 32) Source(19, 46) + SourceIndex(0) +--- +>>> return {}; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1 >) { + > + > +2 > return +3 > +4 > { + > } +5 > +1 >Emitted(9, 9) Source(21, 9) + SourceIndex(0) +2 >Emitted(9, 15) Source(21, 15) + SourceIndex(0) +3 >Emitted(9, 16) Source(21, 16) + SourceIndex(0) +4 >Emitted(9, 18) Source(22, 10) + SourceIndex(0) +5 >Emitted(9, 19) Source(22, 10) + SourceIndex(0) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(10, 5) Source(23, 5) + SourceIndex(0) +2 >Emitted(10, 6) Source(23, 6) + SourceIndex(0) +--- +>>> Element.createElement = createElement; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^-> +1-> +2 > createElement +3 > (args: any[]) { + > + > return { + > } + > } +4 > +1->Emitted(11, 5) Source(19, 21) + SourceIndex(0) +2 >Emitted(11, 26) Source(19, 34) + SourceIndex(0) +3 >Emitted(11, 42) Source(23, 6) + SourceIndex(0) +4 >Emitted(11, 43) Source(23, 6) + SourceIndex(0) +--- +>>>})(Element = exports.Element || (exports.Element = {})); +1-> +2 >^ +3 > ^^ +4 > ^^^^^^^ +5 > ^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^^^^^^^ +1-> + > +2 >} +3 > +4 > Element +5 > +6 > Element +7 > +8 > Element +9 > { + > export function isElement(el: any): el is JSX.Element { + > return el.markAsChildOfRootElement !== undefined; + > } + > + > export function createElement(args: any[]) { + > + > return { + > } + > } + > } +1->Emitted(12, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(24, 2) + SourceIndex(0) +3 >Emitted(12, 4) Source(14, 18) + SourceIndex(0) +4 >Emitted(12, 11) Source(14, 25) + SourceIndex(0) +5 >Emitted(12, 14) Source(14, 18) + SourceIndex(0) +6 >Emitted(12, 29) Source(14, 25) + SourceIndex(0) +7 >Emitted(12, 34) Source(14, 18) + SourceIndex(0) +8 >Emitted(12, 49) Source(14, 25) + SourceIndex(0) +9 >Emitted(12, 57) Source(24, 2) + SourceIndex(0) +--- +>>>exports.createElement = Element.createElement; +1 > +2 >^^^^^^^^ +3 > ^^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^ +8 > ^ +1 > + > + >export let +2 > +3 > createElement +4 > = +5 > Element +6 > . +7 > createElement +8 > ; +1 >Emitted(13, 1) Source(26, 12) + SourceIndex(0) +2 >Emitted(13, 9) Source(26, 12) + SourceIndex(0) +3 >Emitted(13, 22) Source(26, 25) + SourceIndex(0) +4 >Emitted(13, 25) Source(26, 28) + SourceIndex(0) +5 >Emitted(13, 32) Source(26, 35) + SourceIndex(0) +6 >Emitted(13, 33) Source(26, 36) + SourceIndex(0) +7 >Emitted(13, 46) Source(26, 49) + SourceIndex(0) +8 >Emitted(13, 47) Source(26, 50) + SourceIndex(0) +--- +>>>function toCamelCase(text) { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >function toCamelCase( +3 > text: string +1 >Emitted(14, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(14, 22) Source(28, 22) + SourceIndex(0) +3 >Emitted(14, 26) Source(28, 34) + SourceIndex(0) +--- +>>> return text[0].toLowerCase() + text.substring(1); +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +9 > ^^^^^^^^^^^ +10> ^^ +11> ^^^ +12> ^^^^ +13> ^ +14> ^^^^^^^^^ +15> ^ +16> ^ +17> ^ +18> ^ +1->): string { + > +2 > return +3 > +4 > text +5 > [ +6 > 0 +7 > ] +8 > . +9 > toLowerCase +10> () +11> + +12> text +13> . +14> substring +15> ( +16> 1 +17> ) +18> ; +1->Emitted(15, 5) Source(29, 5) + SourceIndex(0) +2 >Emitted(15, 11) Source(29, 11) + SourceIndex(0) +3 >Emitted(15, 12) Source(29, 12) + SourceIndex(0) +4 >Emitted(15, 16) Source(29, 16) + SourceIndex(0) +5 >Emitted(15, 17) Source(29, 17) + SourceIndex(0) +6 >Emitted(15, 18) Source(29, 18) + SourceIndex(0) +7 >Emitted(15, 19) Source(29, 19) + SourceIndex(0) +8 >Emitted(15, 20) Source(29, 20) + SourceIndex(0) +9 >Emitted(15, 31) Source(29, 31) + SourceIndex(0) +10>Emitted(15, 33) Source(29, 33) + SourceIndex(0) +11>Emitted(15, 36) Source(29, 36) + SourceIndex(0) +12>Emitted(15, 40) Source(29, 40) + SourceIndex(0) +13>Emitted(15, 41) Source(29, 41) + SourceIndex(0) +14>Emitted(15, 50) Source(29, 50) + SourceIndex(0) +15>Emitted(15, 51) Source(29, 51) + SourceIndex(0) +16>Emitted(15, 52) Source(29, 52) + SourceIndex(0) +17>Emitted(15, 53) Source(29, 53) + SourceIndex(0) +18>Emitted(15, 54) Source(29, 54) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(16, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(16, 2) Source(30, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=Element.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.tsx +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/test.js +sourceFile:test.tsx +------------------------------------------------------------------- +>>>"use strict"; +>>>const Element_1 = require("./Element"); +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^-> +1 > +2 >import { Element} from './Element'; +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 40) Source(1, 36) + SourceIndex(0) +--- +>>>let createElement = Element_1.Element.createElement; +1-> +2 >^^^^ +3 > ^^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^ +8 > ^ +1-> + > +2 >let +3 > createElement +4 > = +5 > Element +6 > . +7 > createElement +8 > ; +1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) +4 >Emitted(3, 21) Source(2, 21) + SourceIndex(0) +5 >Emitted(3, 38) Source(2, 28) + SourceIndex(0) +6 >Emitted(3, 39) Source(2, 29) + SourceIndex(0) +7 >Emitted(3, 52) Source(2, 42) + SourceIndex(0) +8 >Emitted(3, 53) Source(2, 43) + SourceIndex(0) +--- +>>>let c; +1 > +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^-> +1 > + > +2 >let +3 > c: { + > a?: { + > b: string + > } + > } +4 > ; +1 >Emitted(4, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(4, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(4, 6) Source(7, 2) + SourceIndex(0) +4 >Emitted(4, 7) Source(7, 3) + SourceIndex(0) +--- +>>>class A { +1-> +2 >^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(5, 1) Source(9, 1) + SourceIndex(0) +--- +>>> view() { +1->^^^^ +2 > ^^^^ +3 > ^^^^^^^^^-> +1->class A { + > +2 > view +1->Emitted(6, 5) Source(10, 2) + SourceIndex(0) +2 >Emitted(6, 9) Source(10, 6) + SourceIndex(0) +--- +>>> return [ +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->() { + > +2 > return +3 > +1->Emitted(7, 9) Source(11, 3) + SourceIndex(0) +2 >Emitted(7, 15) Source(11, 9) + SourceIndex(0) +3 >Emitted(7, 16) Source(11, 10) + SourceIndex(0) +--- +>>> createElement("meta", { content: "helloworld" }), +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^^ +1->[ + > +2 > content +4 > = +5 > "helloworld" +6 > > +1->Emitted(8, 13) Source(12, 4) + SourceIndex(0) +2 >Emitted(8, 37) Source(12, 10) + SourceIndex(0) +3 >Emitted(8, 44) Source(12, 17) + SourceIndex(0) +4 >Emitted(8, 46) Source(12, 18) + SourceIndex(0) +5 >Emitted(8, 58) Source(12, 30) + SourceIndex(0) +6 >Emitted(8, 61) Source(12, 38) + SourceIndex(0) +--- +>>> createElement("meta", { content: c.a.b }) +1 >^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +9 > ^ +10> ^^^ +1 >, + > +2 > content +4 > ={ +5 > c +6 > . +7 > a! +8 > . +9 > b +10> }> +1 >Emitted(9, 13) Source(13, 4) + SourceIndex(0) +2 >Emitted(9, 37) Source(13, 10) + SourceIndex(0) +3 >Emitted(9, 44) Source(13, 17) + SourceIndex(0) +4 >Emitted(9, 46) Source(13, 19) + SourceIndex(0) +5 >Emitted(9, 47) Source(13, 20) + SourceIndex(0) +6 >Emitted(9, 48) Source(13, 21) + SourceIndex(0) +7 >Emitted(9, 49) Source(13, 23) + SourceIndex(0) +8 >Emitted(9, 50) Source(13, 24) + SourceIndex(0) +9 >Emitted(9, 51) Source(13, 25) + SourceIndex(0) +10>Emitted(9, 54) Source(13, 34) + SourceIndex(0) +--- +>>> ]; +1 >^^^^^^^^^ +2 > ^ +1 > + > ] +2 > ; +1 >Emitted(10, 10) Source(14, 4) + SourceIndex(0) +2 >Emitted(10, 11) Source(14, 5) + SourceIndex(0) +--- +>>> } +1 >^^^^ +2 > ^ +1 > + > +2 > } +1 >Emitted(11, 5) Source(15, 2) + SourceIndex(0) +2 >Emitted(11, 6) Source(15, 3) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(12, 2) Source(16, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/jsxFactoryQualifiedName.js b/tests/baselines/reference/jsxFactoryQualifiedName.js index e5c7b04f760..80a77d35302 100644 --- a/tests/baselines/reference/jsxFactoryQualifiedName.js +++ b/tests/baselines/reference/jsxFactoryQualifiedName.js @@ -67,7 +67,7 @@ exports.createElement = Element.createElement; function toCamelCase(text) { return text[0].toLowerCase() + text.substring(1); } -//// [test.js] +//# sourceMappingURL=Element.js.map//// [test.js] "use strict"; const Element_1 = require("./Element"); let c; @@ -79,3 +79,4 @@ class A { ]; } } +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/jsxFactoryQualifiedName.js.map b/tests/baselines/reference/jsxFactoryQualifiedName.js.map new file mode 100644 index 00000000000..f8cef24a0f0 --- /dev/null +++ b/tests/baselines/reference/jsxFactoryQualifiedName.js.map @@ -0,0 +1,3 @@ +//// [Element.js.map] +{"version":3,"file":"Element.js","sourceRoot":"","sources":["Element.ts"],"names":[],"mappings":";AAaA,IAAiB,OAAO,CAUvB;AAVD,WAAiB,OAAO;IACpB,mBAA0B,EAAO;QAC7B,MAAM,CAAC,EAAE,CAAC,wBAAwB,KAAK,SAAS,CAAC;IACrD,CAAC;IAFe,iBAAS,YAExB,CAAA;IAED,uBAA8B,IAAW;QAErC,MAAM,CAAC,EACN,CAAA;IACL,CAAC;IAJe,qBAAa,gBAI5B,CAAA;AACL,CAAC,EAVgB,OAAO,GAAP,eAAO,KAAP,eAAO,QAUvB;AAEU,QAAA,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;AAEjD,qBAAqB,IAAY;IAC7B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC"}//// [test.js.map] +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";AAAA,uCAAmC;AAEnC,IAAI,CAIH,CAAC;AAEF;IACC,IAAI;QACH,MAAM,CAAC;YACN,0CAAM,OAAO,EAAC,YAAY,GAAQ;YAClC,0CAAM,OAAO,EAAE,CAAC,CAAC,CAAE,CAAC,CAAC,GAAS;SAC9B,CAAC;IACH,CAAC;CACD"} \ No newline at end of file diff --git a/tests/baselines/reference/jsxFactoryQualifiedName.sourcemap.txt b/tests/baselines/reference/jsxFactoryQualifiedName.sourcemap.txt new file mode 100644 index 00000000000..98517620c73 --- /dev/null +++ b/tests/baselines/reference/jsxFactoryQualifiedName.sourcemap.txt @@ -0,0 +1,493 @@ +=================================================================== +JsFile: Element.js +mapUrl: Element.js.map +sourceRoot: +sources: Element.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/Element.js +sourceFile:Element.ts +------------------------------------------------------------------- +>>>"use strict"; +>>>var Element; +1 > +2 >^^^^ +3 > ^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^-> +1 > + >declare namespace JSX { + > interface Element { + > name: string; + > isIntrinsic: boolean; + > isCustomElement: boolean; + > toString(renderId?: number): string; + > bindDOM(renderId?: number): number; + > resetComponent(): void; + > instantiateComponents(renderId?: number): number; + > props: any; + > } + >} + > +2 >export namespace +3 > Element +4 > { + > export function isElement(el: any): el is JSX.Element { + > return el.markAsChildOfRootElement !== undefined; + > } + > + > export function createElement(args: any[]) { + > + > return { + > } + > } + > } +1 >Emitted(2, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(14, 18) + SourceIndex(0) +3 >Emitted(2, 12) Source(14, 25) + SourceIndex(0) +4 >Emitted(2, 13) Source(24, 2) + SourceIndex(0) +--- +>>>(function (Element) { +1-> +2 >^^^^^^^^^^^ +3 > ^^^^^^^ +4 > ^^^^^^^^^^^-> +1-> +2 >export namespace +3 > Element +1->Emitted(3, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(3, 12) Source(14, 18) + SourceIndex(0) +3 >Emitted(3, 19) Source(14, 25) + SourceIndex(0) +--- +>>> function isElement(el) { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> { + > +2 > export function isElement( +3 > el: any +1->Emitted(4, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(4, 24) Source(15, 31) + SourceIndex(0) +3 >Emitted(4, 26) Source(15, 38) + SourceIndex(0) +--- +>>> return el.markAsChildOfRootElement !== undefined; +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^^^^ +8 > ^^^^^^^^^ +9 > ^ +1->): el is JSX.Element { + > +2 > return +3 > +4 > el +5 > . +6 > markAsChildOfRootElement +7 > !== +8 > undefined +9 > ; +1->Emitted(5, 9) Source(16, 9) + SourceIndex(0) +2 >Emitted(5, 15) Source(16, 15) + SourceIndex(0) +3 >Emitted(5, 16) Source(16, 16) + SourceIndex(0) +4 >Emitted(5, 18) Source(16, 18) + SourceIndex(0) +5 >Emitted(5, 19) Source(16, 19) + SourceIndex(0) +6 >Emitted(5, 43) Source(16, 43) + SourceIndex(0) +7 >Emitted(5, 48) Source(16, 48) + SourceIndex(0) +8 >Emitted(5, 57) Source(16, 57) + SourceIndex(0) +9 >Emitted(5, 58) Source(16, 58) + SourceIndex(0) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(6, 5) Source(17, 5) + SourceIndex(0) +2 >Emitted(6, 6) Source(17, 6) + SourceIndex(0) +--- +>>> Element.isElement = isElement; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^ +4 > ^ +5 > ^-> +1-> +2 > isElement +3 > (el: any): el is JSX.Element { + > return el.markAsChildOfRootElement !== undefined; + > } +4 > +1->Emitted(7, 5) Source(15, 21) + SourceIndex(0) +2 >Emitted(7, 22) Source(15, 30) + SourceIndex(0) +3 >Emitted(7, 34) Source(17, 6) + SourceIndex(0) +4 >Emitted(7, 35) Source(17, 6) + SourceIndex(0) +--- +>>> function createElement(args) { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^ +1-> + > + > +2 > export function createElement( +3 > args: any[] +1->Emitted(8, 5) Source(19, 5) + SourceIndex(0) +2 >Emitted(8, 28) Source(19, 35) + SourceIndex(0) +3 >Emitted(8, 32) Source(19, 46) + SourceIndex(0) +--- +>>> return {}; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +1 >) { + > + > +2 > return +3 > +4 > { + > } +5 > +1 >Emitted(9, 9) Source(21, 9) + SourceIndex(0) +2 >Emitted(9, 15) Source(21, 15) + SourceIndex(0) +3 >Emitted(9, 16) Source(21, 16) + SourceIndex(0) +4 >Emitted(9, 18) Source(22, 10) + SourceIndex(0) +5 >Emitted(9, 19) Source(22, 10) + SourceIndex(0) +--- +>>> } +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(10, 5) Source(23, 5) + SourceIndex(0) +2 >Emitted(10, 6) Source(23, 6) + SourceIndex(0) +--- +>>> Element.createElement = createElement; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^-> +1-> +2 > createElement +3 > (args: any[]) { + > + > return { + > } + > } +4 > +1->Emitted(11, 5) Source(19, 21) + SourceIndex(0) +2 >Emitted(11, 26) Source(19, 34) + SourceIndex(0) +3 >Emitted(11, 42) Source(23, 6) + SourceIndex(0) +4 >Emitted(11, 43) Source(23, 6) + SourceIndex(0) +--- +>>>})(Element = exports.Element || (exports.Element = {})); +1-> +2 >^ +3 > ^^ +4 > ^^^^^^^ +5 > ^^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^^^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^^^^^^^ +1-> + > +2 >} +3 > +4 > Element +5 > +6 > Element +7 > +8 > Element +9 > { + > export function isElement(el: any): el is JSX.Element { + > return el.markAsChildOfRootElement !== undefined; + > } + > + > export function createElement(args: any[]) { + > + > return { + > } + > } + > } +1->Emitted(12, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(12, 2) Source(24, 2) + SourceIndex(0) +3 >Emitted(12, 4) Source(14, 18) + SourceIndex(0) +4 >Emitted(12, 11) Source(14, 25) + SourceIndex(0) +5 >Emitted(12, 14) Source(14, 18) + SourceIndex(0) +6 >Emitted(12, 29) Source(14, 25) + SourceIndex(0) +7 >Emitted(12, 34) Source(14, 18) + SourceIndex(0) +8 >Emitted(12, 49) Source(14, 25) + SourceIndex(0) +9 >Emitted(12, 57) Source(24, 2) + SourceIndex(0) +--- +>>>exports.createElement = Element.createElement; +1 > +2 >^^^^^^^^ +3 > ^^^^^^^^^^^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^ +8 > ^ +1 > + > + >export let +2 > +3 > createElement +4 > = +5 > Element +6 > . +7 > createElement +8 > ; +1 >Emitted(13, 1) Source(26, 12) + SourceIndex(0) +2 >Emitted(13, 9) Source(26, 12) + SourceIndex(0) +3 >Emitted(13, 22) Source(26, 25) + SourceIndex(0) +4 >Emitted(13, 25) Source(26, 28) + SourceIndex(0) +5 >Emitted(13, 32) Source(26, 35) + SourceIndex(0) +6 >Emitted(13, 33) Source(26, 36) + SourceIndex(0) +7 >Emitted(13, 46) Source(26, 49) + SourceIndex(0) +8 >Emitted(13, 47) Source(26, 50) + SourceIndex(0) +--- +>>>function toCamelCase(text) { +1 > +2 >^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >function toCamelCase( +3 > text: string +1 >Emitted(14, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(14, 22) Source(28, 22) + SourceIndex(0) +3 >Emitted(14, 26) Source(28, 34) + SourceIndex(0) +--- +>>> return text[0].toLowerCase() + text.substring(1); +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +9 > ^^^^^^^^^^^ +10> ^^ +11> ^^^ +12> ^^^^ +13> ^ +14> ^^^^^^^^^ +15> ^ +16> ^ +17> ^ +18> ^ +1->): string { + > +2 > return +3 > +4 > text +5 > [ +6 > 0 +7 > ] +8 > . +9 > toLowerCase +10> () +11> + +12> text +13> . +14> substring +15> ( +16> 1 +17> ) +18> ; +1->Emitted(15, 5) Source(29, 5) + SourceIndex(0) +2 >Emitted(15, 11) Source(29, 11) + SourceIndex(0) +3 >Emitted(15, 12) Source(29, 12) + SourceIndex(0) +4 >Emitted(15, 16) Source(29, 16) + SourceIndex(0) +5 >Emitted(15, 17) Source(29, 17) + SourceIndex(0) +6 >Emitted(15, 18) Source(29, 18) + SourceIndex(0) +7 >Emitted(15, 19) Source(29, 19) + SourceIndex(0) +8 >Emitted(15, 20) Source(29, 20) + SourceIndex(0) +9 >Emitted(15, 31) Source(29, 31) + SourceIndex(0) +10>Emitted(15, 33) Source(29, 33) + SourceIndex(0) +11>Emitted(15, 36) Source(29, 36) + SourceIndex(0) +12>Emitted(15, 40) Source(29, 40) + SourceIndex(0) +13>Emitted(15, 41) Source(29, 41) + SourceIndex(0) +14>Emitted(15, 50) Source(29, 50) + SourceIndex(0) +15>Emitted(15, 51) Source(29, 51) + SourceIndex(0) +16>Emitted(15, 52) Source(29, 52) + SourceIndex(0) +17>Emitted(15, 53) Source(29, 53) + SourceIndex(0) +18>Emitted(15, 54) Source(29, 54) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(16, 1) Source(30, 1) + SourceIndex(0) +2 >Emitted(16, 2) Source(30, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=Element.js.map=================================================================== +JsFile: test.js +mapUrl: test.js.map +sourceRoot: +sources: test.tsx +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/test.js +sourceFile:test.tsx +------------------------------------------------------------------- +>>>"use strict"; +>>>const Element_1 = require("./Element"); +1 > +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 >import { Element} from './Element'; +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 40) Source(1, 36) + SourceIndex(0) +--- +>>>let c; +1 > +2 >^^^^ +3 > ^ +4 > ^ +5 > ^^^^-> +1 > + > + > +2 >let +3 > c: { + > a?: { + > b: string + > } + > } +4 > ; +1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +3 >Emitted(3, 6) Source(7, 2) + SourceIndex(0) +4 >Emitted(3, 7) Source(7, 3) + SourceIndex(0) +--- +>>>class A { +1-> +2 >^^^^^^^^^^^^^-> +1-> + > + > +1->Emitted(4, 1) Source(9, 1) + SourceIndex(0) +--- +>>> view() { +1->^^^^ +2 > ^^^^ +3 > ^^^^^^^^^-> +1->class A { + > +2 > view +1->Emitted(5, 5) Source(10, 2) + SourceIndex(0) +2 >Emitted(5, 9) Source(10, 6) + SourceIndex(0) +--- +>>> return [ +1->^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->() { + > +2 > return +3 > +1->Emitted(6, 9) Source(11, 3) + SourceIndex(0) +2 >Emitted(6, 15) Source(11, 9) + SourceIndex(0) +3 >Emitted(6, 16) Source(11, 10) + SourceIndex(0) +--- +>>> Element_1.Element.createElement("meta", { content: "helloworld" }), +1->^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^^ +1->[ + > +2 > content +4 > = +5 > "helloworld" +6 > > +1->Emitted(7, 13) Source(12, 4) + SourceIndex(0) +2 >Emitted(7, 55) Source(12, 10) + SourceIndex(0) +3 >Emitted(7, 62) Source(12, 17) + SourceIndex(0) +4 >Emitted(7, 64) Source(12, 18) + SourceIndex(0) +5 >Emitted(7, 76) Source(12, 30) + SourceIndex(0) +6 >Emitted(7, 79) Source(12, 38) + SourceIndex(0) +--- +>>> Element_1.Element.createElement("meta", { content: c.a.b }) +1 >^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^ +4 > ^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +9 > ^ +10> ^^^ +1 >, + > +2 > content +4 > ={ +5 > c +6 > . +7 > a! +8 > . +9 > b +10> }> +1 >Emitted(8, 13) Source(13, 4) + SourceIndex(0) +2 >Emitted(8, 55) Source(13, 10) + SourceIndex(0) +3 >Emitted(8, 62) Source(13, 17) + SourceIndex(0) +4 >Emitted(8, 64) Source(13, 19) + SourceIndex(0) +5 >Emitted(8, 65) Source(13, 20) + SourceIndex(0) +6 >Emitted(8, 66) Source(13, 21) + SourceIndex(0) +7 >Emitted(8, 67) Source(13, 23) + SourceIndex(0) +8 >Emitted(8, 68) Source(13, 24) + SourceIndex(0) +9 >Emitted(8, 69) Source(13, 25) + SourceIndex(0) +10>Emitted(8, 72) Source(13, 34) + SourceIndex(0) +--- +>>> ]; +1 >^^^^^^^^^ +2 > ^ +1 > + > ] +2 > ; +1 >Emitted(9, 10) Source(14, 4) + SourceIndex(0) +2 >Emitted(9, 11) Source(14, 5) + SourceIndex(0) +--- +>>> } +1 >^^^^ +2 > ^ +1 > + > +2 > } +1 >Emitted(10, 5) Source(15, 2) + SourceIndex(0) +2 >Emitted(10, 6) Source(15, 3) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(11, 2) Source(16, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/cases/compiler/jsxFactoryIdentifier.ts b/tests/cases/compiler/jsxFactoryIdentifier.ts index 9531abeeebf..88caf27482e 100644 --- a/tests/cases/compiler/jsxFactoryIdentifier.ts +++ b/tests/cases/compiler/jsxFactoryIdentifier.ts @@ -2,6 +2,7 @@ //@target: es6 //@module: commonjs //@jsxFactory: createElement +//@sourcemap: true // @filename: Element.ts declare namespace JSX { diff --git a/tests/cases/compiler/jsxFactoryQualifiedName.ts b/tests/cases/compiler/jsxFactoryQualifiedName.ts index c8d9317138b..769b7cd566d 100644 --- a/tests/cases/compiler/jsxFactoryQualifiedName.ts +++ b/tests/cases/compiler/jsxFactoryQualifiedName.ts @@ -2,6 +2,7 @@ //@target: es6 //@module: commonjs //@jsxFactory: Element.createElement +//@sourcemap: true // @filename: Element.ts declare namespace JSX {