From d713c58c6ba88670e92ae79570e4bfc012d488e8 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Thu, 12 May 2016 09:30:21 -0700 Subject: [PATCH] Fix 8532: Correct source map output for computed getter of object literal --- src/compiler/emitter.ts | 2 +- .../computedPropertyNamesSourceMap1_ES5.js | 10 +++ ...computedPropertyNamesSourceMap1_ES5.js.map | 2 +- ...dPropertyNamesSourceMap1_ES5.sourcemap.txt | 81 ++++++++++++++++--- ...omputedPropertyNamesSourceMap1_ES5.symbols | 5 ++ .../computedPropertyNamesSourceMap1_ES5.types | 6 ++ .../computedPropertyNamesSourceMap1_ES6.js | 8 +- ...computedPropertyNamesSourceMap1_ES6.js.map | 2 +- ...dPropertyNamesSourceMap1_ES6.sourcemap.txt | 60 ++++++++++++-- ...omputedPropertyNamesSourceMap1_ES6.symbols | 7 +- .../computedPropertyNamesSourceMap1_ES6.types | 8 +- .../computedPropertyNamesSourceMap2_ES5.js | 12 ++- ...computedPropertyNamesSourceMap2_ES5.js.map | 2 +- ...dPropertyNamesSourceMap2_ES5.sourcemap.txt | 66 +++++++++++++-- ...omputedPropertyNamesSourceMap2_ES5.symbols | 7 +- .../computedPropertyNamesSourceMap2_ES5.types | 12 ++- .../computedPropertyNamesSourceMap2_ES6.js | 8 +- ...computedPropertyNamesSourceMap2_ES6.js.map | 2 +- ...dPropertyNamesSourceMap2_ES6.sourcemap.txt | 56 +++++++++++-- ...omputedPropertyNamesSourceMap2_ES6.symbols | 7 +- .../computedPropertyNamesSourceMap2_ES6.types | 12 ++- .../computedPropertyNamesSourceMap1_ES5.ts | 3 + .../computedPropertyNamesSourceMap1_ES6.ts | 5 +- .../computedPropertyNamesSourceMap2_ES5.ts | 5 +- .../computedPropertyNamesSourceMap2_ES6.ts | 5 +- 25 files changed, 345 insertions(+), 48 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index a1f02f520d8..66290233a98 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1953,7 +1953,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge write("Object.defineProperty("); emit(tempVar); write(", "); - emitStart(node.name); + emitStart(property.name); emitExpressionForPropertyName(property.name); emitEnd(property.name); write(", {"); diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js index 5c4be60bc6e..b03f4d3696e 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js @@ -3,6 +3,9 @@ class C { ["hello"]() { debugger; } + get ["goodbye"]() { + return 0; + } } //// [computedPropertyNamesSourceMap1_ES5.js] @@ -12,6 +15,13 @@ var C = (function () { C.prototype["hello"] = function () { debugger; }; + Object.defineProperty(C.prototype, "goodbye", { + get: function () { + return 0; + }, + enumerable: true, + configurable: true + }); return C; }()); //# sourceMappingURL=computedPropertyNamesSourceMap1_ES5.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js.map index e8d4e52ad96..e94da4e3f80 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js.map @@ -1,2 +1,2 @@ //// [computedPropertyNamesSourceMap1_ES5.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap1_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES5.ts"],"names":[],"mappings":"AAAA;IAAA;IAIA,CAAC;IAHG,YAAC,OAAO,CAAC,GAAT;QACI,QAAQ,CAAC;IACb,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap1_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES5.ts"],"names":[],"mappings":"AAAA;IAAA;IAOA,CAAC;IANG,YAAC,OAAO,CAAC,GAAT;QACI,QAAQ,CAAC;IACb,CAAC;IACD,sBAAI,aAAC,SAAU;aAAf;YACF,MAAM,CAAC,CAAC,CAAC;QACP,CAAC;;;OAAA;IACL,QAAC;AAAD,CAAC,AAPD,IAOC"} \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.sourcemap.txt index 3a64433a709..41484b97c66 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.sourcemap.txt @@ -28,10 +28,13 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts > ["hello"]() { > debugger; > } + > get ["goodbye"]() { + > return 0; + > } > 2 > } -1->Emitted(3, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(3, 6) Source(5, 2) + SourceIndex(0) +1->Emitted(3, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(3, 6) Source(8, 2) + SourceIndex(0) --- >>> C.prototype["hello"] = function () { 1->^^^^ @@ -65,21 +68,78 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts >>> }; 1 >^^^^ 2 > ^ -3 > ^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 > } 1 >Emitted(6, 5) Source(4, 5) + SourceIndex(0) 2 >Emitted(6, 6) Source(4, 6) + SourceIndex(0) --- +>>> Object.defineProperty(C.prototype, "goodbye", { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^ +4 > ^^^^^^^^^ +1-> + > +2 > get +3 > [ +4 > "goodbye"] +1->Emitted(7, 5) Source(5, 5) + SourceIndex(0) +2 >Emitted(7, 27) Source(5, 9) + SourceIndex(0) +3 >Emitted(7, 40) Source(5, 10) + SourceIndex(0) +4 >Emitted(7, 49) Source(5, 20) + SourceIndex(0) +--- +>>> get: function () { +1 >^^^^^^^^^^^^^ +2 > ^^^^^^^^^-> +1 > +1 >Emitted(8, 14) Source(5, 5) + SourceIndex(0) +--- +>>> return 0; +1->^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1->get ["goodbye"]() { + > +2 > return +3 > +4 > 0 +5 > ; +1->Emitted(9, 13) Source(6, 3) + SourceIndex(0) +2 >Emitted(9, 19) Source(6, 9) + SourceIndex(0) +3 >Emitted(9, 20) Source(6, 10) + SourceIndex(0) +4 >Emitted(9, 21) Source(6, 11) + SourceIndex(0) +5 >Emitted(9, 22) Source(6, 12) + SourceIndex(0) +--- +>>> }, +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(10, 9) Source(7, 5) + SourceIndex(0) +2 >Emitted(10, 10) Source(7, 6) + SourceIndex(0) +--- +>>> enumerable: true, +>>> configurable: true +>>> }); +1->^^^^^^^ +2 > ^^^^^^^-> +1-> +1->Emitted(13, 8) Source(7, 6) + SourceIndex(0) +--- >>> return C; 1->^^^^ 2 > ^^^^^^^^ 1-> > 2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 13) Source(5, 2) + SourceIndex(0) +1->Emitted(14, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(14, 13) Source(8, 2) + SourceIndex(0) --- >>>}()); 1 > @@ -94,10 +154,13 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts > ["hello"]() { > debugger; > } + > get ["goodbye"]() { + > return 0; + > } > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(1, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) +1 >Emitted(15, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(15, 2) Source(8, 2) + SourceIndex(0) +3 >Emitted(15, 2) Source(1, 1) + SourceIndex(0) +4 >Emitted(15, 6) Source(8, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=computedPropertyNamesSourceMap1_ES5.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.symbols b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.symbols index f127b919b01..9f4f5110e8f 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.symbols @@ -7,4 +7,9 @@ class C { debugger; } + get ["goodbye"]() { +>"goodbye" : Symbol(C[["goodbye"]], Decl(computedPropertyNamesSourceMap1_ES5.ts, 3, 5)) + + return 0; + } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types index 7f467698a62..528591441b0 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types @@ -7,4 +7,10 @@ class C { debugger; } + get ["goodbye"]() { +>"goodbye" : string + + return 0; +>0 : number + } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js index 749ab99b18b..9e2b762d93b 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js @@ -2,7 +2,10 @@ class C { ["hello"]() { debugger; - } + } + get ["goodbye"]() { + return 0; + } } //// [computedPropertyNamesSourceMap1_ES6.js] @@ -10,5 +13,8 @@ class C { ["hello"]() { debugger; } + get ["goodbye"]() { + return 0; + } } //# sourceMappingURL=computedPropertyNamesSourceMap1_ES6.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map index 9ec6d18cc72..0c9a609211f 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map @@ -1,2 +1,2 @@ //// [computedPropertyNamesSourceMap1_ES6.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap1_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES6.ts"],"names":[],"mappings":"AAAA;IACI,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IACb,CAAC;AACL,CAAC;AAAA"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap1_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES6.ts"],"names":[],"mappings":"AAAA;IACI,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,SAAS,CAAC;QACd,MAAM,CAAC,CAAC,CAAC;IACV,CAAC;AACF,CAAC;AAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt index b589b7ad8ee..87f6e0f46ce 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt @@ -45,11 +45,57 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts >>> } 1 >^^^^ 2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^-> 1 > - > + > 2 > } -1 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) +1 >Emitted(4, 5) Source(4, 2) + SourceIndex(0) +2 >Emitted(4, 6) Source(4, 3) + SourceIndex(0) +--- +>>> get ["goodbye"]() { +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1-> + > +2 > get +3 > [ +4 > "goodbye" +5 > ] +1->Emitted(5, 5) Source(5, 2) + SourceIndex(0) +2 >Emitted(5, 9) Source(5, 6) + SourceIndex(0) +3 >Emitted(5, 10) Source(5, 7) + SourceIndex(0) +4 >Emitted(5, 19) Source(5, 16) + SourceIndex(0) +5 >Emitted(5, 20) Source(5, 17) + SourceIndex(0) +--- +>>> return 0; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >() { + > +2 > return +3 > +4 > 0 +5 > ; +1 >Emitted(6, 9) Source(6, 3) + SourceIndex(0) +2 >Emitted(6, 15) Source(6, 9) + SourceIndex(0) +3 >Emitted(6, 16) Source(6, 10) + SourceIndex(0) +4 >Emitted(6, 17) Source(6, 11) + SourceIndex(0) +5 >Emitted(6, 18) Source(6, 12) + SourceIndex(0) +--- +>>> } +1 >^^^^ +2 > ^ +1 > + > +2 > } +1 >Emitted(7, 5) Source(7, 2) + SourceIndex(0) +2 >Emitted(7, 6) Source(7, 3) + SourceIndex(0) --- >>>} 1 > @@ -58,11 +104,11 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts 1 > > 2 >} -1 >Emitted(5, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 2) Source(5, 2) + SourceIndex(0) +1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(8, 2) Source(8, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=computedPropertyNamesSourceMap1_ES6.js.map1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> -1->Emitted(6, 1) Source(5, 2) + SourceIndex(0) +1->Emitted(9, 1) Source(8, 2) + SourceIndex(0) --- \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.symbols b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.symbols index c8bdcc68835..447bbaebb7c 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.symbols @@ -6,5 +6,10 @@ class C { >"hello" : Symbol(C[["hello"]], Decl(computedPropertyNamesSourceMap1_ES6.ts, 0, 9)) debugger; - } + } + get ["goodbye"]() { +>"goodbye" : Symbol(C[["goodbye"]], Decl(computedPropertyNamesSourceMap1_ES6.ts, 3, 2)) + + return 0; + } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types index 4a78685e8a9..cd7b75384b0 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types @@ -6,5 +6,11 @@ class C { >"hello" : string debugger; - } + } + get ["goodbye"]() { +>"goodbye" : string + + return 0; +>0 : number + } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js index 39e393c46cc..62285665bd0 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js @@ -2,7 +2,10 @@ var v = { ["hello"]() { debugger; - } + }, + get ["goodbye"]() { + return 0; + } } //// [computedPropertyNamesSourceMap2_ES5.js] @@ -10,6 +13,13 @@ var v = (_a = {}, _a["hello"] = function () { debugger; }, + Object.defineProperty(_a, "goodbye", { + get: function () { + return 0; + }, + enumerable: true, + configurable: true + }), _a ); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map index baf1e998efd..74c3e241086 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;IACJ,GAAC,OAAO,CAAC,GAAT;QACI,QAAQ,CAAC;IACb,CAAC;;CACJ,CAAA"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG;IACJ,GAAC,OAAO,CAAC,GAAT;QACI,QAAQ,CAAC;IAChB,CAAC;IACE,0BAAK,SAAU;aAAf;YACF,MAAM,CAAC,CAAC,CAAC;QACV,CAAC;;;MAAA;;CACD,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 f6501777985..280cd68b0cd 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt @@ -56,12 +56,66 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts >>> }, 1 >^^^^ 2 > ^ -3 > ^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > + > 2 > } -1 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) +1 >Emitted(4, 5) Source(4, 2) + SourceIndex(0) +2 >Emitted(4, 6) Source(4, 3) + SourceIndex(0) +--- +>>> Object.defineProperty(_a, "goodbye", { +1->^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 > ^^^^^^^^^ +1->, + > +2 > get [ +3 > "goodbye"] +1->Emitted(5, 5) Source(5, 5) + SourceIndex(0) +2 >Emitted(5, 31) Source(5, 10) + SourceIndex(0) +3 >Emitted(5, 40) Source(5, 20) + SourceIndex(0) +--- +>>> get: function () { +1 >^^^^^^^^^^^^^ +2 > ^^^^^^^^^-> +1 > +1 >Emitted(6, 14) Source(5, 5) + SourceIndex(0) +--- +>>> return 0; +1->^^^^^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1->get ["goodbye"]() { + > +2 > return +3 > +4 > 0 +5 > ; +1->Emitted(7, 13) Source(6, 3) + SourceIndex(0) +2 >Emitted(7, 19) Source(6, 9) + SourceIndex(0) +3 >Emitted(7, 20) Source(6, 10) + SourceIndex(0) +4 >Emitted(7, 21) Source(6, 11) + SourceIndex(0) +5 >Emitted(7, 22) Source(6, 12) + SourceIndex(0) +--- +>>> }, +1 >^^^^^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(8, 9) Source(7, 2) + SourceIndex(0) +2 >Emitted(8, 10) Source(7, 3) + SourceIndex(0) +--- +>>> enumerable: true, +>>> configurable: true +>>> }), +1->^^^^^^ +2 > ^-> +1-> +1->Emitted(11, 7) Source(7, 3) + SourceIndex(0) --- >>> _a >>>); @@ -71,8 +125,8 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 1-> >} 2 > -1->Emitted(6, 2) Source(5, 2) + SourceIndex(0) -2 >Emitted(6, 3) Source(5, 2) + SourceIndex(0) +1->Emitted(13, 2) Source(8, 2) + SourceIndex(0) +2 >Emitted(13, 3) Source(8, 2) + SourceIndex(0) --- >>>var _a; >>>//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.symbols b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.symbols index 5e159065410..e01453c1d12 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.symbols @@ -6,5 +6,10 @@ var v = { >"hello" : Symbol(["hello"], Decl(computedPropertyNamesSourceMap2_ES5.ts, 0, 9)) debugger; - } + }, + get ["goodbye"]() { +>"goodbye" : Symbol(["goodbye"], Decl(computedPropertyNamesSourceMap2_ES5.ts, 3, 3)) + + return 0; + } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types index 147b2966509..29b64c990c2 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types @@ -1,11 +1,17 @@ === tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES5.ts === var v = { ->v : { ["hello"](): void; } ->{ ["hello"]() { debugger; }} : { ["hello"](): void; } +>v : { ["hello"](): void; readonly ["goodbye"]: number; } +>{ ["hello"]() { debugger; }, get ["goodbye"]() { return 0; }} : { ["hello"](): void; readonly ["goodbye"]: number; } ["hello"]() { >"hello" : string debugger; - } + }, + get ["goodbye"]() { +>"goodbye" : string + + return 0; +>0 : number + } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js index 3d0274e65c7..d342fe272eb 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js @@ -2,13 +2,19 @@ var v = { ["hello"]() { debugger; - } + }, + get ["goodbye"]() { + return 0; + } } //// [computedPropertyNamesSourceMap2_ES6.js] var v = { ["hello"]() { debugger; + }, + get ["goodbye"]() { + return 0; } }; //# sourceMappingURL=computedPropertyNamesSourceMap2_ES6.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js.map index f8ca7ab5845..e1f238177b2 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js.map @@ -1,2 +1,2 @@ //// [computedPropertyNamesSourceMap2_ES6.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap2_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES6.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG;IACJ,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IACb,CAAC;CACJ,CAAA"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap2_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES6.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG;IACJ,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,SAAS,CAAC;QACd,MAAM,CAAC,CAAC,CAAC;IACV,CAAC;CACD,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.sourcemap.txt index a6f9086e455..e0aeed1efbd 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.sourcemap.txt @@ -51,14 +51,60 @@ sourceFile:computedPropertyNamesSourceMap2_ES6.ts 2 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) 3 >Emitted(3, 18) Source(3, 18) + SourceIndex(0) --- +>>> }, +1 >^^^^ +2 > ^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 > } +1 >Emitted(4, 5) Source(4, 2) + SourceIndex(0) +2 >Emitted(4, 6) Source(4, 3) + SourceIndex(0) +--- +>>> get ["goodbye"]() { +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^^^^^^^ +5 > ^ +1->, + > +2 > get +3 > [ +4 > "goodbye" +5 > ] +1->Emitted(5, 5) Source(5, 2) + SourceIndex(0) +2 >Emitted(5, 9) Source(5, 6) + SourceIndex(0) +3 >Emitted(5, 10) Source(5, 7) + SourceIndex(0) +4 >Emitted(5, 19) Source(5, 16) + SourceIndex(0) +5 >Emitted(5, 20) Source(5, 17) + SourceIndex(0) +--- +>>> return 0; +1 >^^^^^^^^ +2 > ^^^^^^ +3 > ^ +4 > ^ +5 > ^ +1 >() { + > +2 > return +3 > +4 > 0 +5 > ; +1 >Emitted(6, 9) Source(6, 3) + SourceIndex(0) +2 >Emitted(6, 15) Source(6, 9) + SourceIndex(0) +3 >Emitted(6, 16) Source(6, 10) + SourceIndex(0) +4 >Emitted(6, 17) Source(6, 11) + SourceIndex(0) +5 >Emitted(6, 18) Source(6, 12) + SourceIndex(0) +--- >>> } 1 >^^^^ 2 > ^ 1 > - > + > 2 > } -1 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) +1 >Emitted(7, 5) Source(7, 2) + SourceIndex(0) +2 >Emitted(7, 6) Source(7, 3) + SourceIndex(0) --- >>>}; 1 >^ @@ -67,7 +113,7 @@ sourceFile:computedPropertyNamesSourceMap2_ES6.ts 1 > >} 2 > -1 >Emitted(5, 2) Source(5, 2) + SourceIndex(0) -2 >Emitted(5, 3) Source(5, 2) + SourceIndex(0) +1 >Emitted(8, 2) Source(8, 2) + SourceIndex(0) +2 >Emitted(8, 3) Source(8, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=computedPropertyNamesSourceMap2_ES6.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.symbols b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.symbols index e2985711b83..d4b85e28398 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.symbols @@ -6,5 +6,10 @@ var v = { >"hello" : Symbol(["hello"], Decl(computedPropertyNamesSourceMap2_ES6.ts, 0, 9)) debugger; - } + }, + get ["goodbye"]() { +>"goodbye" : Symbol(["goodbye"], Decl(computedPropertyNamesSourceMap2_ES6.ts, 3, 3)) + + return 0; + } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types index 00334680362..fea16b5de8d 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types @@ -1,11 +1,17 @@ === tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES6.ts === var v = { ->v : { ["hello"](): void; } ->{ ["hello"]() { debugger; }} : { ["hello"](): void; } +>v : { ["hello"](): void; readonly ["goodbye"]: number; } +>{ ["hello"]() { debugger; }, get ["goodbye"]() { return 0; }} : { ["hello"](): void; readonly ["goodbye"]: number; } ["hello"]() { >"hello" : string debugger; - } + }, + get ["goodbye"]() { +>"goodbye" : string + + return 0; +>0 : number + } } diff --git a/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap1_ES5.ts b/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap1_ES5.ts index 9454483cdb4..5eb378ebc4c 100644 --- a/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap1_ES5.ts +++ b/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap1_ES5.ts @@ -4,4 +4,7 @@ class C { ["hello"]() { debugger; } + get ["goodbye"]() { + return 0; + } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap1_ES6.ts b/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap1_ES6.ts index 73d9dc215d9..bb7080e760f 100644 --- a/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap1_ES6.ts +++ b/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap1_ES6.ts @@ -3,5 +3,8 @@ class C { ["hello"]() { debugger; - } + } + get ["goodbye"]() { + return 0; + } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES5.ts b/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES5.ts index 3d35cd12430..53e3a515773 100644 --- a/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES5.ts +++ b/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES5.ts @@ -3,5 +3,8 @@ var v = { ["hello"]() { debugger; - } + }, + get ["goodbye"]() { + return 0; + } } \ No newline at end of file diff --git a/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES6.ts b/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES6.ts index fc7f4fcb39d..49d048445c8 100644 --- a/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES6.ts +++ b/tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES6.ts @@ -3,5 +3,8 @@ var v = { ["hello"]() { debugger; - } + }, + get ["goodbye"]() { + return 0; + } } \ No newline at end of file