diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 8f01232ef77..3fef1735a2d 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2067,6 +2067,9 @@ module ts { function emitNodeWithMap(node: Node) { if (node) { + if (nodeIsSynthesized(node)) { + return emitNode(node); + } if (node.kind != SyntaxKind.SourceFile) { recordEmitNodeStartSpan(node); emitNode(node); @@ -3517,9 +3520,6 @@ module ts { var endPos = emitToken(SyntaxKind.ForKeyword, node.pos); write(" "); endPos = emitToken(SyntaxKind.OpenParenToken, endPos); - // This is the var keyword for the counter and rhsReference. The var keyword for - // the LHS will be emitted inside the body. - write("var "); // Do not emit the LHS var declaration yet, because it might contain destructuring. @@ -3533,29 +3533,42 @@ module ts { var rhsIsIdentifier = node.expression.kind === SyntaxKind.Identifier; var counter = createTempVariable(node, /*forLoopVariable*/ true); var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node, /*forLoopVariable*/ false); + + // This is the var keyword for the counter and rhsReference. The var keyword for + // the LHS will be emitted inside the body. + emitStart(node.expression); + write("var "); // _i = 0 - emit(counter); + emitNode(counter); write(" = 0"); + emitEnd(node.expression); if (!rhsIsIdentifier) { // , _a = expr write(", "); - emit(rhsReference); + emitStart(node.expression); + emitNode(rhsReference); write(" = "); - emit(node.expression); + emitNode(node.expression); + emitEnd(node.expression); } write("; "); // _i < _a.length; - emit(counter); + emitStart(node.initializer); + emitNode(counter); write(" < "); - emit(rhsReference); - write(".length; "); + emitNode(rhsReference); + write(".length"); + emitEnd(node.initializer); + write("; "); // _i++) - emit(counter); + emitStart(node.initializer); + emitNode(counter); write("++"); + emitEnd(node.initializer); emitToken(SyntaxKind.CloseParenToken, node.expression.end); // Body @@ -3566,6 +3579,7 @@ module ts { // Initialize LHS // var v = _a[_i]; var rhsIterationValue = createElementAccessExpression(rhsReference, counter); + emitStart(node.initializer); if (node.initializer.kind === SyntaxKind.VariableDeclarationList) { write("var "); var variableDeclarationList = node.initializer; @@ -3579,18 +3593,18 @@ module ts { else { // The following call does not include the initializer, so we have // to emit it separately. - emit(declaration); + emitNode(declaration); write(" = "); - emit(rhsIterationValue); + emitNode(rhsIterationValue); } } else { // It's an empty declaration list. This can only happen in an error case, if the user wrote // for (var of []) {} var emptyDeclarationListTemp = createTempVariable(node, /*forLoopVariable*/ false); - emit(emptyDeclarationListTemp); + emitNode(emptyDeclarationListTemp); write(" = "); - emit(rhsIterationValue); + emitNode(rhsIterationValue); } } else { @@ -3604,9 +3618,10 @@ module ts { emitDestructuring(assignmentExpressionStatement); } else { - emit(assignmentExpression); + emitNode(assignmentExpression); } } + emitEnd(node.initializer); write(";"); if (node.statement.kind === SyntaxKind.Block) { diff --git a/tests/baselines/reference/ES5For-of1.js b/tests/baselines/reference/ES5For-of1.js index 8001d5b537f..dffe843399f 100644 --- a/tests/baselines/reference/ES5For-of1.js +++ b/tests/baselines/reference/ES5For-of1.js @@ -1,7 +1,11 @@ //// [ES5For-of1.ts] -for (var v of []) { } +for (var v of ['a', 'b', 'c']) { + console.log(v); +} //// [ES5For-of1.js] -for (var _i = 0, _a = []; _i < _a.length; _i++) { +for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { var v = _a[_i]; + console.log(v); } +//# sourceMappingURL=ES5For-of1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of1.js.map b/tests/baselines/reference/ES5For-of1.js.map new file mode 100644 index 00000000000..568ac1987e7 --- /dev/null +++ b/tests/baselines/reference/ES5For-of1.js.map @@ -0,0 +1,2 @@ +//// [ES5For-of1.js.map] +{"version":3,"file":"ES5For-of1.js","sourceRoot":"","sources":["ES5For-of1.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAClB"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of1.sourcemap.txt b/tests/baselines/reference/ES5For-of1.sourcemap.txt new file mode 100644 index 00000000000..7bdd7edfa13 --- /dev/null +++ b/tests/baselines/reference/ES5For-of1.sourcemap.txt @@ -0,0 +1,116 @@ +=================================================================== +JsFile: ES5For-of1.js +mapUrl: ES5For-of1.js.map +sourceRoot: +sources: ES5For-of1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of1.js +sourceFile:ES5For-of1.ts +------------------------------------------------------------------- +>>>for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { +1 > +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^ +9 > ^^ +10> ^^^ +11> ^^ +12> ^^^ +13> ^ +14> ^^ +15> ^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^ +18> ^ +1 > +2 >for +3 > +4 > (var v of +5 > ['a', 'b', 'c'] +6 > +7 > [ +8 > 'a' +9 > , +10> 'b' +11> , +12> 'c' +13> ] +14> +15> var v +16> +17> var v of ['a', 'b', 'c'] +18> ) +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) +3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +4 >Emitted(1, 6) Source(1, 15) + SourceIndex(0) +5 >Emitted(1, 16) Source(1, 30) + SourceIndex(0) +6 >Emitted(1, 18) Source(1, 15) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 16) + SourceIndex(0) +8 >Emitted(1, 27) Source(1, 19) + SourceIndex(0) +9 >Emitted(1, 29) Source(1, 21) + SourceIndex(0) +10>Emitted(1, 32) Source(1, 24) + SourceIndex(0) +11>Emitted(1, 34) Source(1, 26) + SourceIndex(0) +12>Emitted(1, 37) Source(1, 29) + SourceIndex(0) +13>Emitted(1, 38) Source(1, 30) + SourceIndex(0) +14>Emitted(1, 40) Source(1, 6) + SourceIndex(0) +15>Emitted(1, 54) Source(1, 11) + SourceIndex(0) +16>Emitted(1, 56) Source(1, 6) + SourceIndex(0) +17>Emitted(1, 60) Source(1, 30) + SourceIndex(0) +18>Emitted(1, 61) Source(1, 31) + SourceIndex(0) +--- +>>> var v = _a[_i]; +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^^-> +1 > +2 > var +3 > v +4 > +1 >Emitted(2, 5) Source(1, 6) + SourceIndex(0) +2 >Emitted(2, 9) Source(1, 10) + SourceIndex(0) +3 >Emitted(2, 10) Source(1, 11) + SourceIndex(0) +4 >Emitted(2, 19) Source(1, 11) + SourceIndex(0) +--- +>>> console.log(v); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +1-> of ['a', 'b', 'c']) { + > +2 > console +3 > . +4 > log +5 > ( +6 > v +7 > ) +8 > ; +1->Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) +4 >Emitted(3, 16) Source(2, 16) + SourceIndex(0) +5 >Emitted(3, 17) Source(2, 17) + SourceIndex(0) +6 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) +7 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) +8 >Emitted(3, 20) Source(2, 20) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=ES5For-of1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of13.js b/tests/baselines/reference/ES5For-of13.js index 93aa8dec765..2bcf98e14f1 100644 --- a/tests/baselines/reference/ES5For-of13.js +++ b/tests/baselines/reference/ES5For-of13.js @@ -1,10 +1,11 @@ //// [ES5For-of13.ts] -for (let v of []) { +for (let v of ['a', 'b', 'c']) { var x = v; } //// [ES5For-of13.js] -for (var _i = 0, _a = []; _i < _a.length; _i++) { +for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { var v = _a[_i]; var x = v; } +//# sourceMappingURL=ES5For-of13.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of13.js.map b/tests/baselines/reference/ES5For-of13.js.map new file mode 100644 index 00000000000..5ff54bb8816 --- /dev/null +++ b/tests/baselines/reference/ES5For-of13.js.map @@ -0,0 +1,2 @@ +//// [ES5For-of13.js.map] +{"version":3,"file":"ES5For-of13.js","sourceRoot":"","sources":["ES5For-of13.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CACb"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of13.sourcemap.txt b/tests/baselines/reference/ES5For-of13.sourcemap.txt new file mode 100644 index 00000000000..c3a188e7221 --- /dev/null +++ b/tests/baselines/reference/ES5For-of13.sourcemap.txt @@ -0,0 +1,109 @@ +=================================================================== +JsFile: ES5For-of13.js +mapUrl: ES5For-of13.js.map +sourceRoot: +sources: ES5For-of13.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of13.js +sourceFile:ES5For-of13.ts +------------------------------------------------------------------- +>>>for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { +1 > +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^ +9 > ^^ +10> ^^^ +11> ^^ +12> ^^^ +13> ^ +14> ^^ +15> ^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^ +18> ^ +1 > +2 >for +3 > +4 > (let v of +5 > ['a', 'b', 'c'] +6 > +7 > [ +8 > 'a' +9 > , +10> 'b' +11> , +12> 'c' +13> ] +14> +15> let v +16> +17> let v of ['a', 'b', 'c'] +18> ) +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) +3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +4 >Emitted(1, 6) Source(1, 15) + SourceIndex(0) +5 >Emitted(1, 16) Source(1, 30) + SourceIndex(0) +6 >Emitted(1, 18) Source(1, 15) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 16) + SourceIndex(0) +8 >Emitted(1, 27) Source(1, 19) + SourceIndex(0) +9 >Emitted(1, 29) Source(1, 21) + SourceIndex(0) +10>Emitted(1, 32) Source(1, 24) + SourceIndex(0) +11>Emitted(1, 34) Source(1, 26) + SourceIndex(0) +12>Emitted(1, 37) Source(1, 29) + SourceIndex(0) +13>Emitted(1, 38) Source(1, 30) + SourceIndex(0) +14>Emitted(1, 40) Source(1, 6) + SourceIndex(0) +15>Emitted(1, 54) Source(1, 11) + SourceIndex(0) +16>Emitted(1, 56) Source(1, 6) + SourceIndex(0) +17>Emitted(1, 60) Source(1, 30) + SourceIndex(0) +18>Emitted(1, 61) Source(1, 31) + SourceIndex(0) +--- +>>> var v = _a[_i]; +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^^^^^^^ +1 > +2 > let +3 > v +4 > +1 >Emitted(2, 5) Source(1, 6) + SourceIndex(0) +2 >Emitted(2, 9) Source(1, 10) + SourceIndex(0) +3 >Emitted(2, 10) Source(1, 11) + SourceIndex(0) +4 >Emitted(2, 19) Source(1, 11) + SourceIndex(0) +--- +>>> var x = v; +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +1 > of ['a', 'b', 'c']) { + > +2 > var +3 > x +4 > = +5 > v +6 > ; +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 9) + SourceIndex(0) +3 >Emitted(3, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) +5 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) +6 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=ES5For-of13.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of25.js b/tests/baselines/reference/ES5For-of25.js index 5e52f7cad5d..756c14fbe81 100644 --- a/tests/baselines/reference/ES5For-of25.js +++ b/tests/baselines/reference/ES5For-of25.js @@ -12,3 +12,4 @@ for (var _i = 0; _i < a.length; _i++) { v; a; } +//# sourceMappingURL=ES5For-of25.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of25.js.map b/tests/baselines/reference/ES5For-of25.js.map new file mode 100644 index 00000000000..cc31767128b --- /dev/null +++ b/tests/baselines/reference/ES5For-of25.js.map @@ -0,0 +1,2 @@ +//// [ES5For-of25.js.map] +{"version":3,"file":"ES5For-of25.js","sourceRoot":"","sources":["ES5For-of25.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,GAAG,CAAC,CAAU,UAAC,EAAV,aAAK,EAAL,IAAU,CAAC;IAAX,IAAI,CAAC,GAAI,CAAC,IAAL;IACN,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of25.sourcemap.txt b/tests/baselines/reference/ES5For-of25.sourcemap.txt new file mode 100644 index 00000000000..623627fde20 --- /dev/null +++ b/tests/baselines/reference/ES5For-of25.sourcemap.txt @@ -0,0 +1,135 @@ +=================================================================== +JsFile: ES5For-of25.js +mapUrl: ES5For-of25.js.map +sourceRoot: +sources: ES5For-of25.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of25.js +sourceFile:ES5For-of25.ts +------------------------------------------------------------------- +>>>var a = [1, 2, 3]; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^^ +8 > ^ +9 > ^^ +10> ^ +11> ^ +12> ^ +13> ^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >var +3 > a +4 > = +5 > [ +6 > 1 +7 > , +8 > 2 +9 > , +10> 3 +11> ] +12> ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) +5 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +6 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +7 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +8 >Emitted(1, 14) Source(1, 14) + SourceIndex(0) +9 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) +10>Emitted(1, 17) Source(1, 17) + SourceIndex(0) +11>Emitted(1, 18) Source(1, 18) + SourceIndex(0) +12>Emitted(1, 19) Source(1, 19) + SourceIndex(0) +--- +>>>for (var _i = 0; _i < a.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^ +1-> + > +2 >for +3 > +4 > (var v of +5 > a +6 > +7 > var v +8 > +9 > var v of a +10> ) +1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(2, 4) Source(2, 4) + SourceIndex(0) +3 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +4 >Emitted(2, 6) Source(2, 15) + SourceIndex(0) +5 >Emitted(2, 16) Source(2, 16) + SourceIndex(0) +6 >Emitted(2, 18) Source(2, 6) + SourceIndex(0) +7 >Emitted(2, 31) Source(2, 11) + SourceIndex(0) +8 >Emitted(2, 33) Source(2, 6) + SourceIndex(0) +9 >Emitted(2, 37) Source(2, 16) + SourceIndex(0) +10>Emitted(2, 38) Source(2, 17) + SourceIndex(0) +--- +>>> var v = a[_i]; +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^ +1 > +2 > var +3 > v +4 > of +5 > a +6 > +1 >Emitted(3, 5) Source(2, 6) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 10) + SourceIndex(0) +3 >Emitted(3, 10) Source(2, 11) + SourceIndex(0) +4 >Emitted(3, 13) Source(2, 15) + SourceIndex(0) +5 >Emitted(3, 14) Source(2, 16) + SourceIndex(0) +6 >Emitted(3, 18) Source(2, 11) + SourceIndex(0) +--- +>>> v; +1 >^^^^ +2 > ^ +3 > ^ +4 > ^-> +1 > of a) { + > +2 > v +3 > ; +1 >Emitted(4, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0) +3 >Emitted(4, 7) Source(3, 7) + SourceIndex(0) +--- +>>> a; +1->^^^^ +2 > ^ +3 > ^ +1-> + > +2 > a +3 > ; +1->Emitted(5, 5) Source(4, 5) + SourceIndex(0) +2 >Emitted(5, 6) Source(4, 6) + SourceIndex(0) +3 >Emitted(5, 7) Source(4, 7) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=ES5For-of25.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of26.js b/tests/baselines/reference/ES5For-of26.js index 02d462b6025..4571cc660a3 100644 --- a/tests/baselines/reference/ES5For-of26.js +++ b/tests/baselines/reference/ES5For-of26.js @@ -10,3 +10,4 @@ for (var _i = 0, _a = [2, 3]; _i < _a.length; _i++) { a; b; } +//# sourceMappingURL=ES5For-of26.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of26.js.map b/tests/baselines/reference/ES5For-of26.js.map new file mode 100644 index 00000000000..704a3a24f2a --- /dev/null +++ b/tests/baselines/reference/ES5For-of26.js.map @@ -0,0 +1,2 @@ +//// [ES5For-of26.js.map] +{"version":3,"file":"ES5For-of26.js","sourceRoot":"","sources":["ES5For-of26.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAuB,UAAM,EAAN,MAAC,CAAC,EAAE,CAAC,CAAC,EAA5B,cAAkB,EAAlB,IAA4B,CAAC;IAA7B,6BAAK,CAAC,mBAAG,CAAC,mBAAE,CAAC,mBAAG,CAAC,KAAC;IACnB,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of26.sourcemap.txt b/tests/baselines/reference/ES5For-of26.sourcemap.txt new file mode 100644 index 00000000000..c9942b1e861 --- /dev/null +++ b/tests/baselines/reference/ES5For-of26.sourcemap.txt @@ -0,0 +1,126 @@ +=================================================================== +JsFile: ES5For-of26.js +mapUrl: ES5For-of26.js.map +sourceRoot: +sources: ES5For-of26.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of26.js +sourceFile:ES5For-of26.ts +------------------------------------------------------------------- +>>>for (var _i = 0, _a = [2, 3]; _i < _a.length; _i++) { +1 > +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ +16> ^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >for +3 > +4 > (var [a = 0, b = 1] of +5 > [2, 3] +6 > +7 > [ +8 > 2 +9 > , +10> 3 +11> ] +12> +13> var [a = 0, b = 1] +14> +15> var [a = 0, b = 1] of [2, 3] +16> ) +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) +3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +4 >Emitted(1, 6) Source(1, 28) + SourceIndex(0) +5 >Emitted(1, 16) Source(1, 34) + SourceIndex(0) +6 >Emitted(1, 18) Source(1, 28) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 29) + SourceIndex(0) +8 >Emitted(1, 25) Source(1, 30) + SourceIndex(0) +9 >Emitted(1, 27) Source(1, 32) + SourceIndex(0) +10>Emitted(1, 28) Source(1, 33) + SourceIndex(0) +11>Emitted(1, 29) Source(1, 34) + SourceIndex(0) +12>Emitted(1, 31) Source(1, 6) + SourceIndex(0) +13>Emitted(1, 45) Source(1, 24) + SourceIndex(0) +14>Emitted(1, 47) Source(1, 6) + SourceIndex(0) +15>Emitted(1, 51) Source(1, 34) + SourceIndex(0) +16>Emitted(1, 52) Source(1, 35) + SourceIndex(0) +--- +>>> var _b = _a[_i], _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d; +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^ +5 > ^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^ +8 > ^^^^^^^^^^^^^^^^^^^ +9 > ^ +10> ^^^^^ +1-> +2 > var [ +3 > a +4 > = +5 > 0 +6 > , +7 > b +8 > = +9 > 1 +10> ] +1->Emitted(2, 5) Source(1, 6) + SourceIndex(0) +2 >Emitted(2, 34) Source(1, 11) + SourceIndex(0) +3 >Emitted(2, 35) Source(1, 12) + SourceIndex(0) +4 >Emitted(2, 54) Source(1, 15) + SourceIndex(0) +5 >Emitted(2, 55) Source(1, 16) + SourceIndex(0) +6 >Emitted(2, 74) Source(1, 18) + SourceIndex(0) +7 >Emitted(2, 75) Source(1, 19) + SourceIndex(0) +8 >Emitted(2, 94) Source(1, 22) + SourceIndex(0) +9 >Emitted(2, 95) Source(1, 23) + SourceIndex(0) +10>Emitted(2, 100) Source(1, 24) + SourceIndex(0) +--- +>>> a; +1 >^^^^ +2 > ^ +3 > ^ +4 > ^-> +1 > of [2, 3]) { + > +2 > a +3 > ; +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 6) Source(2, 6) + SourceIndex(0) +3 >Emitted(3, 7) Source(2, 7) + SourceIndex(0) +--- +>>> b; +1->^^^^ +2 > ^ +3 > ^ +1-> + > +2 > b +3 > ; +1->Emitted(4, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0) +3 >Emitted(4, 7) Source(3, 7) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(5, 2) Source(4, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=ES5For-of26.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of3.js b/tests/baselines/reference/ES5For-of3.js index c36110443b4..648d34a9b16 100644 --- a/tests/baselines/reference/ES5For-of3.js +++ b/tests/baselines/reference/ES5For-of3.js @@ -1,9 +1,10 @@ //// [ES5For-of3.ts] -for (var v of []) +for (var v of ['a', 'b', 'c']) var x = v; //// [ES5For-of3.js] -for (var _i = 0, _a = []; _i < _a.length; _i++) { +for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { var v = _a[_i]; var x = v; } +//# sourceMappingURL=ES5For-of3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of3.js.map b/tests/baselines/reference/ES5For-of3.js.map new file mode 100644 index 00000000000..7454e1ca85d --- /dev/null +++ b/tests/baselines/reference/ES5For-of3.js.map @@ -0,0 +1,2 @@ +//// [ES5For-of3.js.map] +{"version":3,"file":"ES5For-of3.js","sourceRoot":"","sources":["ES5For-of3.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of3.sourcemap.txt b/tests/baselines/reference/ES5For-of3.sourcemap.txt new file mode 100644 index 00000000000..dd0bca37b68 --- /dev/null +++ b/tests/baselines/reference/ES5For-of3.sourcemap.txt @@ -0,0 +1,108 @@ +=================================================================== +JsFile: ES5For-of3.js +mapUrl: ES5For-of3.js.map +sourceRoot: +sources: ES5For-of3.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of3.js +sourceFile:ES5For-of3.ts +------------------------------------------------------------------- +>>>for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { +1 > +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^ +9 > ^^ +10> ^^^ +11> ^^ +12> ^^^ +13> ^ +14> ^^ +15> ^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^ +18> ^ +1 > +2 >for +3 > +4 > (var v of +5 > ['a', 'b', 'c'] +6 > +7 > [ +8 > 'a' +9 > , +10> 'b' +11> , +12> 'c' +13> ] +14> +15> var v +16> +17> var v of ['a', 'b', 'c'] +18> ) +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) +3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) +4 >Emitted(1, 6) Source(1, 15) + SourceIndex(0) +5 >Emitted(1, 16) Source(1, 30) + SourceIndex(0) +6 >Emitted(1, 18) Source(1, 15) + SourceIndex(0) +7 >Emitted(1, 24) Source(1, 16) + SourceIndex(0) +8 >Emitted(1, 27) Source(1, 19) + SourceIndex(0) +9 >Emitted(1, 29) Source(1, 21) + SourceIndex(0) +10>Emitted(1, 32) Source(1, 24) + SourceIndex(0) +11>Emitted(1, 34) Source(1, 26) + SourceIndex(0) +12>Emitted(1, 37) Source(1, 29) + SourceIndex(0) +13>Emitted(1, 38) Source(1, 30) + SourceIndex(0) +14>Emitted(1, 40) Source(1, 6) + SourceIndex(0) +15>Emitted(1, 54) Source(1, 11) + SourceIndex(0) +16>Emitted(1, 56) Source(1, 6) + SourceIndex(0) +17>Emitted(1, 60) Source(1, 30) + SourceIndex(0) +18>Emitted(1, 61) Source(1, 31) + SourceIndex(0) +--- +>>> var v = _a[_i]; +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^^^^^^^ +1 > +2 > var +3 > v +4 > +1 >Emitted(2, 5) Source(1, 6) + SourceIndex(0) +2 >Emitted(2, 9) Source(1, 10) + SourceIndex(0) +3 >Emitted(2, 10) Source(1, 11) + SourceIndex(0) +4 >Emitted(2, 19) Source(1, 11) + SourceIndex(0) +--- +>>> var x = v; +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +1 > of ['a', 'b', 'c']) + > +2 > var +3 > x +4 > = +5 > v +6 > ; +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 9) + SourceIndex(0) +3 >Emitted(3, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) +5 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) +6 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +1 >Emitted(4, 2) Source(2, 15) + SourceIndex(0) +--- +>>>//# sourceMappingURL=ES5For-of3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of8.js b/tests/baselines/reference/ES5For-of8.js index a3d20b92056..dbe747b9690 100644 --- a/tests/baselines/reference/ES5For-of8.js +++ b/tests/baselines/reference/ES5For-of8.js @@ -2,7 +2,7 @@ function foo() { return { x: 0 }; } -for (foo().x of []) { +for (foo().x of ['a', 'b', 'c']) { var p = foo().x; } @@ -10,7 +10,8 @@ for (foo().x of []) { function foo() { return { x: 0 }; } -for (var _i = 0, _a = []; _i < _a.length; _i++) { +for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { foo().x = _a[_i]; var p = foo().x; } +//# sourceMappingURL=ES5For-of8.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of8.js.map b/tests/baselines/reference/ES5For-of8.js.map new file mode 100644 index 00000000000..23dec486d8d --- /dev/null +++ b/tests/baselines/reference/ES5For-of8.js.map @@ -0,0 +1,2 @@ +//// [ES5For-of8.js.map] +{"version":3,"file":"ES5For-of8.js","sourceRoot":"","sources":["ES5For-of8.ts"],"names":["foo"],"mappings":"AAAA,SAAS,GAAG;IACRA,MAAMA,CAACA,EAAEA,CAACA,EAAEA,CAACA,EAAEA,CAACA;AACpBA,CAACA;AACD,GAAG,CAAC,CAAY,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAA1B,cAAO,EAAP,IAA0B,CAAC;IAA3B,GAAG,EAAE,CAAC,CAAC,SAAA;IACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;CACnB"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of8.sourcemap.txt b/tests/baselines/reference/ES5For-of8.sourcemap.txt new file mode 100644 index 00000000000..e1cf66513a2 --- /dev/null +++ b/tests/baselines/reference/ES5For-of8.sourcemap.txt @@ -0,0 +1,178 @@ +=================================================================== +JsFile: ES5For-of8.js +mapUrl: ES5For-of8.js.map +sourceRoot: +sources: ES5For-of8.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of8.js +sourceFile:ES5For-of8.ts +------------------------------------------------------------------- +>>>function foo() { +1 > +2 >^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^-> +1 > +2 >function +3 > foo +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +--- +>>> return { x: 0 }; +1->^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +6 > ^^ +7 > ^ +8 > ^^ +9 > ^ +1->() { + > +2 > return +3 > +4 > { +5 > x +6 > : +7 > 0 +8 > } +9 > ; +1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) name (foo) +2 >Emitted(2, 11) Source(2, 11) + SourceIndex(0) name (foo) +3 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) name (foo) +4 >Emitted(2, 14) Source(2, 14) + SourceIndex(0) name (foo) +5 >Emitted(2, 15) Source(2, 15) + SourceIndex(0) name (foo) +6 >Emitted(2, 17) Source(2, 17) + SourceIndex(0) name (foo) +7 >Emitted(2, 18) Source(2, 18) + SourceIndex(0) name (foo) +8 >Emitted(2, 20) Source(2, 20) + SourceIndex(0) name (foo) +9 >Emitted(2, 21) Source(2, 21) + SourceIndex(0) name (foo) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) name (foo) +2 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) name (foo) +--- +>>>for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { +1-> +2 >^^^ +3 > ^ +4 > ^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^^ +9 > ^^ +10> ^^^ +11> ^^ +12> ^^^ +13> ^ +14> ^^ +15> ^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^ +18> ^ +1-> + > +2 >for +3 > +4 > (foo().x of +5 > ['a', 'b', 'c'] +6 > +7 > [ +8 > 'a' +9 > , +10> 'b' +11> , +12> 'c' +13> ] +14> +15> foo().x +16> +17> foo().x of ['a', 'b', 'c'] +18> ) +1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 4) Source(4, 4) + SourceIndex(0) +3 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) +4 >Emitted(4, 6) Source(4, 17) + SourceIndex(0) +5 >Emitted(4, 16) Source(4, 32) + SourceIndex(0) +6 >Emitted(4, 18) Source(4, 17) + SourceIndex(0) +7 >Emitted(4, 24) Source(4, 18) + SourceIndex(0) +8 >Emitted(4, 27) Source(4, 21) + SourceIndex(0) +9 >Emitted(4, 29) Source(4, 23) + SourceIndex(0) +10>Emitted(4, 32) Source(4, 26) + SourceIndex(0) +11>Emitted(4, 34) Source(4, 28) + SourceIndex(0) +12>Emitted(4, 37) Source(4, 31) + SourceIndex(0) +13>Emitted(4, 38) Source(4, 32) + SourceIndex(0) +14>Emitted(4, 40) Source(4, 6) + SourceIndex(0) +15>Emitted(4, 54) Source(4, 13) + SourceIndex(0) +16>Emitted(4, 56) Source(4, 6) + SourceIndex(0) +17>Emitted(4, 60) Source(4, 32) + SourceIndex(0) +18>Emitted(4, 61) Source(4, 33) + SourceIndex(0) +--- +>>> foo().x = _a[_i]; +1 >^^^^ +2 > ^^^ +3 > ^^ +4 > ^ +5 > ^ +6 > ^^^^^^^^^ +7 > ^-> +1 > +2 > foo +3 > () +4 > . +5 > x +6 > +1 >Emitted(5, 5) Source(4, 6) + SourceIndex(0) +2 >Emitted(5, 8) Source(4, 9) + SourceIndex(0) +3 >Emitted(5, 10) Source(4, 11) + SourceIndex(0) +4 >Emitted(5, 11) Source(4, 12) + SourceIndex(0) +5 >Emitted(5, 12) Source(4, 13) + SourceIndex(0) +6 >Emitted(5, 21) Source(4, 13) + SourceIndex(0) +--- +>>> var p = foo().x; +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^^ +6 > ^^ +7 > ^ +8 > ^ +9 > ^ +1-> of ['a', 'b', 'c']) { + > +2 > var +3 > p +4 > = +5 > foo +6 > () +7 > . +8 > x +9 > ; +1->Emitted(6, 5) Source(5, 5) + SourceIndex(0) +2 >Emitted(6, 9) Source(5, 9) + SourceIndex(0) +3 >Emitted(6, 10) Source(5, 10) + SourceIndex(0) +4 >Emitted(6, 13) Source(5, 13) + SourceIndex(0) +5 >Emitted(6, 16) Source(5, 16) + SourceIndex(0) +6 >Emitted(6, 18) Source(5, 18) + SourceIndex(0) +7 >Emitted(6, 19) Source(5, 19) + SourceIndex(0) +8 >Emitted(6, 20) Source(5, 20) + SourceIndex(0) +9 >Emitted(6, 21) Source(5, 21) + SourceIndex(0) +--- +>>>} +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + >} +1 >Emitted(7, 2) Source(6, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=ES5For-of8.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map index d4df74499d0..413c98fa456 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map @@ -1,2 +1,2 @@ //// [computedPropertyNamesSourceMap2_ES5.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,AADA,CAAA,EAAA,GAAA,EAAA;IAAA,EAAA,CAEA,OAAO,CAFA,GAAA;QAGA,QAAQ,CAAC;IACb,CAAC,AAJA;IAAA,EAAA,CAKA,CAAA;IALA,EAAA"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG;OACH,OAAO;QACJ,QAAQ,CAAC;IACb,CAAC;OACJ,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt index e1a4f764f42..03eec606718 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt @@ -13,144 +13,56 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 2 >^^^^ 3 > ^ 4 > ^^^ -5 > -6 > ^ -7 > ^^ -8 > ^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^-> +5 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > 2 >var 3 > v 4 > = -5 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found -5 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 9) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 9) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -5 > -6 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column -6 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 9) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 10) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -6 > -7 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found -7 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 10) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 12) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -7 > -8 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column -8 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 10) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 15) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -8 > -9 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found -9 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 12) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 17) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -9 > 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) 3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) 4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) -5 >Emitted(1, 9) Source(0, NaN) + SourceIndex(0) -6 >Emitted(1, 10) Source(0, NaN) + SourceIndex(0) -7 >Emitted(1, 12) Source(0, NaN) + SourceIndex(0) -8 >Emitted(1, 15) Source(0, NaN) + SourceIndex(0) -9 >Emitted(1, 17) Source(0, NaN) + SourceIndex(0) --- >>> _a["hello"] = function () { -1->^^^^ -2 > ^^ -3 > ^ -4 > ^^^^^^^ -5 > ^ -6 > ^^^ -1->!!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column -1->!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 12) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 5) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -1-> -2 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found -2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 15) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 7) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -2 > -3 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column -3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 15) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 8) Source(2, 6) + SourceIndex(0) nameIndex (-1) -3 > -4 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found -4 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 17) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 15) Source(2, 13) + SourceIndex(0) nameIndex (-1) -4 > "hello" -5 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column -5 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 17) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 16) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -5 > -6 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found -6 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 5) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 19) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -6 > -1->Emitted(2, 5) Source(0, NaN) + SourceIndex(0) -2 >Emitted(2, 7) Source(0, NaN) + SourceIndex(0) -3 >Emitted(2, 8) Source(2, 6) + SourceIndex(0) -4 >Emitted(2, 15) Source(2, 13) + SourceIndex(0) -5 >Emitted(2, 16) Source(0, NaN) + SourceIndex(0) -6 >Emitted(2, 19) Source(0, NaN) + SourceIndex(0) +1->^^^^^^^ +2 > ^^^^^^^ +3 > ^^^^-> +1->{ + > [ +2 > "hello" +1->Emitted(2, 8) Source(2, 6) + SourceIndex(0) +2 >Emitted(2, 15) Source(2, 13) + SourceIndex(0) --- >>> debugger; -1 >^^^^^^^^ +1->^^^^^^^^ 2 > ^^^^^^^^ 3 > ^ -1 >!!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column -1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 5) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(3, 9) Source(3, 9) + SourceIndex(0) nameIndex (-1) -1 > -2 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found -2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 7) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(3, 17) Source(3, 17) + SourceIndex(0) nameIndex (-1) +1->]() { + > 2 > debugger -3 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column -3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 7) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(3, 18) Source(3, 18) + SourceIndex(0) nameIndex (-1) 3 > ; -1 >Emitted(3, 9) Source(3, 9) + SourceIndex(0) +1->Emitted(3, 9) Source(3, 9) + SourceIndex(0) 2 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) 3 >Emitted(3, 18) Source(3, 18) + SourceIndex(0) --- >>> }, 1 >^^^^ 2 > ^ -3 > -4 > ^^^^-> -1 >!!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: -1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 8) Source(2, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 5) Source(4, 5) + SourceIndex(0) nameIndex (-1) +3 > ^^^^-> 1 > > -2 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: -2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 15) Source(2, 16) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 6) Source(4, 6) + SourceIndex(0) nameIndex (-1) 2 > } -3 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found -3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 16) Source(0, 16) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 6) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -3 > 1 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) 2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) -3 >Emitted(4, 6) Source(0, NaN) + SourceIndex(0) --- >>> _a); -1->^^^^ -2 > ^^ -3 > ^ -4 > ^ -1->!!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column -1->!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 16) Source(0, 16) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 5) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -1-> -2 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found -2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 19) Source(0, 16) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 7) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -2 > -3 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column -3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 19) Source(0, 16) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 8) Source(5, 2) + SourceIndex(0) nameIndex (-1) -3 > -4 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: -4 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 9) Source(3, 16) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 9) Source(5, 2) + SourceIndex(0) nameIndex (-1) -4 > -1->Emitted(5, 5) Source(0, NaN) + SourceIndex(0) -2 >Emitted(5, 7) Source(0, NaN) + SourceIndex(0) -3 >Emitted(5, 8) Source(5, 2) + SourceIndex(0) -4 >Emitted(5, 9) Source(5, 2) + SourceIndex(0) +1->^^^^^^^ +2 > ^ +1-> + >} +2 > +1->Emitted(5, 8) Source(5, 2) + SourceIndex(0) +2 >Emitted(5, 9) Source(5, 2) + SourceIndex(0) --- >>>var _a; -1 >^^^^ -2 > ^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 >!!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: -1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 17) Source(3, 24) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(6, 5) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -1 > -2 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: -2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 18) Source(3, 25) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(6, 7) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -2 > -1 >Emitted(6, 5) Source(0, NaN) + SourceIndex(0) -2 >Emitted(6, 7) Source(0, NaN) + SourceIndex(0) ---- -!!!! **** There are more source map entries in the sourceMap's mapping than what was encoded -!!!! **** Remaining decoded string: ;IACb,CAAC,AAJA;IAAA,EAAA,CAKA,CAAA;IALA,EAAA >>>//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map \ No newline at end of file diff --git a/tests/cases/conformance/statements/for-ofStatements/ES5For-of1.ts b/tests/cases/conformance/statements/for-ofStatements/ES5For-of1.ts index 24bb2f9759f..3dd4ec5a360 100644 --- a/tests/cases/conformance/statements/for-ofStatements/ES5For-of1.ts +++ b/tests/cases/conformance/statements/for-ofStatements/ES5For-of1.ts @@ -1 +1,4 @@ -for (var v of []) { } \ No newline at end of file +//@sourcemap: true +for (var v of ['a', 'b', 'c']) { + console.log(v); +} \ No newline at end of file diff --git a/tests/cases/conformance/statements/for-ofStatements/ES5For-of13.ts b/tests/cases/conformance/statements/for-ofStatements/ES5For-of13.ts index 743cdf919f6..274d8541bc6 100644 --- a/tests/cases/conformance/statements/for-ofStatements/ES5For-of13.ts +++ b/tests/cases/conformance/statements/for-ofStatements/ES5For-of13.ts @@ -1,3 +1,4 @@ -for (let v of []) { +//@sourcemap: true +for (let v of ['a', 'b', 'c']) { var x = v; } \ No newline at end of file diff --git a/tests/cases/conformance/statements/for-ofStatements/ES5For-of25.ts b/tests/cases/conformance/statements/for-ofStatements/ES5For-of25.ts index 5cf7efe8d65..7017991c7f2 100644 --- a/tests/cases/conformance/statements/for-ofStatements/ES5For-of25.ts +++ b/tests/cases/conformance/statements/for-ofStatements/ES5For-of25.ts @@ -1,3 +1,4 @@ +//@sourcemap: true var a = [1, 2, 3]; for (var v of a) { v; diff --git a/tests/cases/conformance/statements/for-ofStatements/ES5For-of26.ts b/tests/cases/conformance/statements/for-ofStatements/ES5For-of26.ts index d0b944dcec7..13a386309bb 100644 --- a/tests/cases/conformance/statements/for-ofStatements/ES5For-of26.ts +++ b/tests/cases/conformance/statements/for-ofStatements/ES5For-of26.ts @@ -1,3 +1,4 @@ +//@sourcemap: true for (var [a = 0, b = 1] of [2, 3]) { a; b; diff --git a/tests/cases/conformance/statements/for-ofStatements/ES5For-of3.ts b/tests/cases/conformance/statements/for-ofStatements/ES5For-of3.ts index 4543b6f74ec..c2fb21f68ce 100644 --- a/tests/cases/conformance/statements/for-ofStatements/ES5For-of3.ts +++ b/tests/cases/conformance/statements/for-ofStatements/ES5For-of3.ts @@ -1,2 +1,3 @@ -for (var v of []) +//@sourcemap: true +for (var v of ['a', 'b', 'c']) var x = v; \ No newline at end of file diff --git a/tests/cases/conformance/statements/for-ofStatements/ES5For-of32.ts b/tests/cases/conformance/statements/for-ofStatements/ES5For-of32.ts deleted file mode 100644 index 65ad9bdbdc3..00000000000 --- a/tests/cases/conformance/statements/for-ofStatements/ES5For-of32.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @sourcemap: true -for (var a of ['a', 'b', 'c']) { - console.log(a); -} \ No newline at end of file diff --git a/tests/cases/conformance/statements/for-ofStatements/ES5For-of8.ts b/tests/cases/conformance/statements/for-ofStatements/ES5For-of8.ts index 5ad1fb7d58f..e902f50031e 100644 --- a/tests/cases/conformance/statements/for-ofStatements/ES5For-of8.ts +++ b/tests/cases/conformance/statements/for-ofStatements/ES5For-of8.ts @@ -1,6 +1,7 @@ +//@sourcemap: true function foo() { return { x: 0 }; } -for (foo().x of []) { +for (foo().x of ['a', 'b', 'c']) { var p = foo().x; } \ No newline at end of file