diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js new file mode 100644 index 00000000000..4a56f449ecc --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js @@ -0,0 +1,53 @@ +//// [sourceMapValidationDestructuringParameterObjectBindingPattern.ts] +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; + +function foo1({ name: nameA }: Robot) { + console.log(nameA); +} +function foo2({ name: nameB, skill: skillB }: Robot) { + console.log(nameB); +} +function foo3({ name }: Robot) { + console.log(name); +} + +foo1(robotA); +foo1({ name: "Edger", skill: "cutting edges" }); + +foo2(robotA); +foo2({ name: "Edger", skill: "cutting edges" }); + +foo3(robotA); +foo3({ name: "Edger", skill: "cutting edges" }); + + +//// [sourceMapValidationDestructuringParameterObjectBindingPattern.js] +var hello = "hello"; +var robotA = { name: "mower", skill: "mowing" }; +function foo1(_a) { + var nameA = _a.name; + console.log(nameA); +} +function foo2(_a) { + var nameB = _a.name, skillB = _a.skill; + console.log(nameB); +} +function foo3(_a) { + var name = _a.name; + console.log(name); +} +foo1(robotA); +foo1({ name: "Edger", skill: "cutting edges" }); +foo2(robotA); +foo2({ name: "Edger", skill: "cutting edges" }); +foo3(robotA); +foo3({ name: "Edger", skill: "cutting edges" }); +//# sourceMappingURL=sourceMapValidationDestructuringParameterObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js.map new file mode 100644 index 00000000000..9290f57f89d --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.js.map @@ -0,0 +1,2 @@ +//// [sourceMapValidationDestructuringParameterObjectBindingPattern.js.map] +{"version":3,"file":"sourceMapValidationDestructuringParameterObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringParameterObjectBindingPattern.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAEvD,cAAc,EAAsB;QAAtB,eAAsB;IAChC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,cAAc,EAAqC;QAAnC,eAAW,EAAE,iBAAa;IACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,cAAc,EAAe;QAAf,cAAe;IACzB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC;AAED,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC;AAEhD,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC;AAEhD,IAAI,CAAC,MAAM,CAAC,CAAC;AACb,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.sourcemap.txt new file mode 100644 index 00000000000..63eea72d8a0 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.sourcemap.txt @@ -0,0 +1,472 @@ +=================================================================== +JsFile: sourceMapValidationDestructuringParameterObjectBindingPattern.js +mapUrl: sourceMapValidationDestructuringParameterObjectBindingPattern.js.map +sourceRoot: +sources: sourceMapValidationDestructuringParameterObjectBindingPattern.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.js +sourceFile:sourceMapValidationDestructuringParameterObjectBindingPattern.ts +------------------------------------------------------------------- +>>>var hello = "hello"; +1 > +2 >^^^^ +3 > ^^^^^ +4 > ^^^ +5 > ^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >interface Robot { + > name: string; + > skill: string; + >} + >declare var console: { + > log(msg: string): void; + >} + > +2 >var +3 > hello +4 > = +5 > "hello" +6 > ; +1 >Emitted(1, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(8, 5) + SourceIndex(0) +3 >Emitted(1, 10) Source(8, 10) + SourceIndex(0) +4 >Emitted(1, 13) Source(8, 13) + SourceIndex(0) +5 >Emitted(1, 20) Source(8, 20) + SourceIndex(0) +6 >Emitted(1, 21) Source(8, 21) + SourceIndex(0) +--- +>>>var robotA = { name: "mower", skill: "mowing" }; +1-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^ +6 > ^^^^ +7 > ^^ +8 > ^^^^^^^ +9 > ^^ +10> ^^^^^ +11> ^^ +12> ^^^^^^^^ +13> ^^ +14> ^ +1-> + > +2 >var +3 > robotA +4 > : Robot = +5 > { +6 > name +7 > : +8 > "mower" +9 > , +10> skill +11> : +12> "mowing" +13> } +14> ; +1->Emitted(2, 1) Source(9, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(9, 5) + SourceIndex(0) +3 >Emitted(2, 11) Source(9, 11) + SourceIndex(0) +4 >Emitted(2, 14) Source(9, 21) + SourceIndex(0) +5 >Emitted(2, 16) Source(9, 23) + SourceIndex(0) +6 >Emitted(2, 20) Source(9, 27) + SourceIndex(0) +7 >Emitted(2, 22) Source(9, 29) + SourceIndex(0) +8 >Emitted(2, 29) Source(9, 36) + SourceIndex(0) +9 >Emitted(2, 31) Source(9, 38) + SourceIndex(0) +10>Emitted(2, 36) Source(9, 43) + SourceIndex(0) +11>Emitted(2, 38) Source(9, 45) + SourceIndex(0) +12>Emitted(2, 46) Source(9, 53) + SourceIndex(0) +13>Emitted(2, 48) Source(9, 55) + SourceIndex(0) +14>Emitted(2, 49) Source(9, 56) + SourceIndex(0) +--- +>>>function foo1(_a) { +1 > +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^-> +1 > + > + > +2 >function foo1( +3 > { name: nameA }: Robot +1 >Emitted(3, 1) Source(11, 1) + SourceIndex(0) +2 >Emitted(3, 15) Source(11, 15) + SourceIndex(0) +3 >Emitted(3, 17) Source(11, 37) + SourceIndex(0) +--- +>>> var nameA = _a.name; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^-> +1-> +2 > { name: nameA }: Robot +1->Emitted(4, 9) Source(11, 15) + SourceIndex(0) +2 >Emitted(4, 24) Source(11, 37) + SourceIndex(0) +--- +>>> console.log(nameA); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1->) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameA +7 > ) +8 > ; +1->Emitted(5, 5) Source(12, 5) + SourceIndex(0) +2 >Emitted(5, 12) Source(12, 12) + SourceIndex(0) +3 >Emitted(5, 13) Source(12, 13) + SourceIndex(0) +4 >Emitted(5, 16) Source(12, 16) + SourceIndex(0) +5 >Emitted(5, 17) Source(12, 17) + SourceIndex(0) +6 >Emitted(5, 22) Source(12, 22) + SourceIndex(0) +7 >Emitted(5, 23) Source(12, 23) + SourceIndex(0) +8 >Emitted(5, 24) Source(12, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(6, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(13, 2) + SourceIndex(0) +--- +>>>function foo2(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >function foo2( +3 > { name: nameB, skill: skillB }: Robot +1->Emitted(7, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(7, 15) Source(14, 15) + SourceIndex(0) +3 >Emitted(7, 17) Source(14, 52) + SourceIndex(0) +--- +>>> var nameB = _a.name, skillB = _a.skill; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^ +1-> +2 > name: nameB +3 > , +4 > skill: skillB +1->Emitted(8, 9) Source(14, 17) + SourceIndex(0) +2 >Emitted(8, 24) Source(14, 28) + SourceIndex(0) +3 >Emitted(8, 26) Source(14, 30) + SourceIndex(0) +4 >Emitted(8, 43) Source(14, 43) + SourceIndex(0) +--- +>>> console.log(nameB); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^^ +7 > ^ +8 > ^ +1 > }: Robot) { + > +2 > console +3 > . +4 > log +5 > ( +6 > nameB +7 > ) +8 > ; +1 >Emitted(9, 5) Source(15, 5) + SourceIndex(0) +2 >Emitted(9, 12) Source(15, 12) + SourceIndex(0) +3 >Emitted(9, 13) Source(15, 13) + SourceIndex(0) +4 >Emitted(9, 16) Source(15, 16) + SourceIndex(0) +5 >Emitted(9, 17) Source(15, 17) + SourceIndex(0) +6 >Emitted(9, 22) Source(15, 22) + SourceIndex(0) +7 >Emitted(9, 23) Source(15, 23) + SourceIndex(0) +8 >Emitted(9, 24) Source(15, 24) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(10, 1) Source(16, 1) + SourceIndex(0) +2 >Emitted(10, 2) Source(16, 2) + SourceIndex(0) +--- +>>>function foo3(_a) { +1-> +2 >^^^^^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^-> +1-> + > +2 >function foo3( +3 > { name }: Robot +1->Emitted(11, 1) Source(17, 1) + SourceIndex(0) +2 >Emitted(11, 15) Source(17, 15) + SourceIndex(0) +3 >Emitted(11, 17) Source(17, 30) + SourceIndex(0) +--- +>>> var name = _a.name; +1->^^^^^^^^ +2 > ^^^^^^^^^^^^^^ +3 > ^-> +1-> +2 > { name }: Robot +1->Emitted(12, 9) Source(17, 15) + SourceIndex(0) +2 >Emitted(12, 23) Source(17, 30) + SourceIndex(0) +--- +>>> console.log(name); +1->^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^^ +7 > ^ +8 > ^ +1->) { + > +2 > console +3 > . +4 > log +5 > ( +6 > name +7 > ) +8 > ; +1->Emitted(13, 5) Source(18, 5) + SourceIndex(0) +2 >Emitted(13, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(13, 13) Source(18, 13) + SourceIndex(0) +4 >Emitted(13, 16) Source(18, 16) + SourceIndex(0) +5 >Emitted(13, 17) Source(18, 17) + SourceIndex(0) +6 >Emitted(13, 21) Source(18, 21) + SourceIndex(0) +7 >Emitted(13, 22) Source(18, 22) + SourceIndex(0) +8 >Emitted(13, 23) Source(18, 23) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(14, 1) Source(19, 1) + SourceIndex(0) +2 >Emitted(14, 2) Source(19, 2) + SourceIndex(0) +--- +>>>foo1(robotA); +1-> +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > + > +2 >foo1 +3 > ( +4 > robotA +5 > ) +6 > ; +1->Emitted(15, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(15, 5) Source(21, 5) + SourceIndex(0) +3 >Emitted(15, 6) Source(21, 6) + SourceIndex(0) +4 >Emitted(15, 12) Source(21, 12) + SourceIndex(0) +5 >Emitted(15, 13) Source(21, 13) + SourceIndex(0) +6 >Emitted(15, 14) Source(21, 14) + SourceIndex(0) +--- +>>>foo1({ name: "Edger", skill: "cutting edges" }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^ +1-> + > +2 >foo1 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skill +10> : +11> "cutting edges" +12> } +13> ) +14> ; +1->Emitted(16, 1) Source(22, 1) + SourceIndex(0) +2 >Emitted(16, 5) Source(22, 5) + SourceIndex(0) +3 >Emitted(16, 6) Source(22, 6) + SourceIndex(0) +4 >Emitted(16, 8) Source(22, 8) + SourceIndex(0) +5 >Emitted(16, 12) Source(22, 12) + SourceIndex(0) +6 >Emitted(16, 14) Source(22, 14) + SourceIndex(0) +7 >Emitted(16, 21) Source(22, 21) + SourceIndex(0) +8 >Emitted(16, 23) Source(22, 23) + SourceIndex(0) +9 >Emitted(16, 28) Source(22, 28) + SourceIndex(0) +10>Emitted(16, 30) Source(22, 30) + SourceIndex(0) +11>Emitted(16, 45) Source(22, 45) + SourceIndex(0) +12>Emitted(16, 47) Source(22, 47) + SourceIndex(0) +13>Emitted(16, 48) Source(22, 48) + SourceIndex(0) +14>Emitted(16, 49) Source(22, 49) + SourceIndex(0) +--- +>>>foo2(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo2 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(17, 1) Source(24, 1) + SourceIndex(0) +2 >Emitted(17, 5) Source(24, 5) + SourceIndex(0) +3 >Emitted(17, 6) Source(24, 6) + SourceIndex(0) +4 >Emitted(17, 12) Source(24, 12) + SourceIndex(0) +5 >Emitted(17, 13) Source(24, 13) + SourceIndex(0) +6 >Emitted(17, 14) Source(24, 14) + SourceIndex(0) +--- +>>>foo2({ name: "Edger", skill: "cutting edges" }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^ +1-> + > +2 >foo2 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skill +10> : +11> "cutting edges" +12> } +13> ) +14> ; +1->Emitted(18, 1) Source(25, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(25, 5) + SourceIndex(0) +3 >Emitted(18, 6) Source(25, 6) + SourceIndex(0) +4 >Emitted(18, 8) Source(25, 8) + SourceIndex(0) +5 >Emitted(18, 12) Source(25, 12) + SourceIndex(0) +6 >Emitted(18, 14) Source(25, 14) + SourceIndex(0) +7 >Emitted(18, 21) Source(25, 21) + SourceIndex(0) +8 >Emitted(18, 23) Source(25, 23) + SourceIndex(0) +9 >Emitted(18, 28) Source(25, 28) + SourceIndex(0) +10>Emitted(18, 30) Source(25, 30) + SourceIndex(0) +11>Emitted(18, 45) Source(25, 45) + SourceIndex(0) +12>Emitted(18, 47) Source(25, 47) + SourceIndex(0) +13>Emitted(18, 48) Source(25, 48) + SourceIndex(0) +14>Emitted(18, 49) Source(25, 49) + SourceIndex(0) +--- +>>>foo3(robotA); +1 > +2 >^^^^ +3 > ^ +4 > ^^^^^^ +5 > ^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > + > +2 >foo3 +3 > ( +4 > robotA +5 > ) +6 > ; +1 >Emitted(19, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(27, 5) + SourceIndex(0) +3 >Emitted(19, 6) Source(27, 6) + SourceIndex(0) +4 >Emitted(19, 12) Source(27, 12) + SourceIndex(0) +5 >Emitted(19, 13) Source(27, 13) + SourceIndex(0) +6 >Emitted(19, 14) Source(27, 14) + SourceIndex(0) +--- +>>>foo3({ name: "Edger", skill: "cutting edges" }); +1-> +2 >^^^^ +3 > ^ +4 > ^^ +5 > ^^^^ +6 > ^^ +7 > ^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1-> + > +2 >foo3 +3 > ( +4 > { +5 > name +6 > : +7 > "Edger" +8 > , +9 > skill +10> : +11> "cutting edges" +12> } +13> ) +14> ; +1->Emitted(20, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(20, 5) Source(28, 5) + SourceIndex(0) +3 >Emitted(20, 6) Source(28, 6) + SourceIndex(0) +4 >Emitted(20, 8) Source(28, 8) + SourceIndex(0) +5 >Emitted(20, 12) Source(28, 12) + SourceIndex(0) +6 >Emitted(20, 14) Source(28, 14) + SourceIndex(0) +7 >Emitted(20, 21) Source(28, 21) + SourceIndex(0) +8 >Emitted(20, 23) Source(28, 23) + SourceIndex(0) +9 >Emitted(20, 28) Source(28, 28) + SourceIndex(0) +10>Emitted(20, 30) Source(28, 30) + SourceIndex(0) +11>Emitted(20, 45) Source(28, 45) + SourceIndex(0) +12>Emitted(20, 47) Source(28, 47) + SourceIndex(0) +13>Emitted(20, 48) Source(28, 48) + SourceIndex(0) +14>Emitted(20, 49) Source(28, 49) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationDestructuringParameterObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.symbols b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.symbols new file mode 100644 index 00000000000..9b810165c1b --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.symbols @@ -0,0 +1,91 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts === +interface Robot { +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 17)) + + skill: string; +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 1, 17)) +} +declare var console: { +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 11)) + + log(msg: string): void; +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>msg : Symbol(msg, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 5, 8)) +} +var hello = "hello"; +>hello : Symbol(hello, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 7, 3)) + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 3)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 0)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 21)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 36)) + +function foo1({ name: nameA }: Robot) { +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 55)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 17)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 10, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 0)) + + console.log(nameA); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>nameA : Symbol(nameA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 10, 15)) +} +function foo2({ name: nameB, skill: skillB }: Robot) { +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 12, 1)) +>name : Symbol(Robot.name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 17)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 13, 15)) +>skill : Symbol(Robot.skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 1, 17)) +>skillB : Symbol(skillB, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 13, 28)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 0)) + + console.log(nameB); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>nameB : Symbol(nameB, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 13, 15)) +} +function foo3({ name }: Robot) { +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 15, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 16, 15)) +>Robot : Symbol(Robot, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 0, 0)) + + console.log(name); +>console.log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>console : Symbol(console, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 11)) +>log : Symbol(log, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 4, 22)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 16, 15)) +} + +foo1(robotA); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 55)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 3)) + +foo1({ name: "Edger", skill: "cutting edges" }); +>foo1 : Symbol(foo1, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 55)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 21, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 21, 21)) + +foo2(robotA); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 12, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 3)) + +foo2({ name: "Edger", skill: "cutting edges" }); +>foo2 : Symbol(foo2, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 12, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 24, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 24, 21)) + +foo3(robotA); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 15, 1)) +>robotA : Symbol(robotA, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 8, 3)) + +foo3({ name: "Edger", skill: "cutting edges" }); +>foo3 : Symbol(foo3, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 15, 1)) +>name : Symbol(name, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 27, 6)) +>skill : Symbol(skill, Decl(sourceMapValidationDestructuringParameterObjectBindingPattern.ts, 27, 21)) + diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types new file mode 100644 index 00000000000..894cd714c73 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types @@ -0,0 +1,113 @@ +=== tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts === +interface Robot { +>Robot : Robot + + name: string; +>name : string + + skill: string; +>skill : string +} +declare var console: { +>console : { log(msg: string): void; } + + log(msg: string): void; +>log : (msg: string) => void +>msg : string +} +var hello = "hello"; +>hello : string +>"hello" : string + +var robotA: Robot = { name: "mower", skill: "mowing" }; +>robotA : Robot +>Robot : Robot +>{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>name : string +>"mower" : string +>skill : string +>"mowing" : string + +function foo1({ name: nameA }: Robot) { +>foo1 : ({ name: nameA }: Robot) => void +>name : any +>nameA : string +>Robot : Robot + + console.log(nameA); +>console.log(nameA) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameA : string +} +function foo2({ name: nameB, skill: skillB }: Robot) { +>foo2 : ({ name: nameB, skill: skillB }: Robot) => void +>name : any +>nameB : string +>skill : any +>skillB : string +>Robot : Robot + + console.log(nameB); +>console.log(nameB) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>nameB : string +} +function foo3({ name }: Robot) { +>foo3 : ({ name }: Robot) => void +>name : string +>Robot : Robot + + console.log(name); +>console.log(name) : void +>console.log : (msg: string) => void +>console : { log(msg: string): void; } +>log : (msg: string) => void +>name : string +} + +foo1(robotA); +>foo1(robotA) : void +>foo1 : ({ name: nameA }: Robot) => void +>robotA : Robot + +foo1({ name: "Edger", skill: "cutting edges" }); +>foo1({ name: "Edger", skill: "cutting edges" }) : void +>foo1 : ({ name: nameA }: Robot) => void +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + +foo2(robotA); +>foo2(robotA) : void +>foo2 : ({ name: nameB, skill: skillB }: Robot) => void +>robotA : Robot + +foo2({ name: "Edger", skill: "cutting edges" }); +>foo2({ name: "Edger", skill: "cutting edges" }) : void +>foo2 : ({ name: nameB, skill: skillB }: Robot) => void +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + +foo3(robotA); +>foo3(robotA) : void +>foo3 : ({ name }: Robot) => void +>robotA : Robot + +foo3({ name: "Edger", skill: "cutting edges" }); +>foo3({ name: "Edger", skill: "cutting edges" }) : void +>foo3 : ({ name }: Robot) => void +>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>name : string +>"Edger" : string +>skill : string +>"cutting edges" : string + diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts new file mode 100644 index 00000000000..0f52806dd16 --- /dev/null +++ b/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts @@ -0,0 +1,29 @@ +// @sourcemap: true +interface Robot { + name: string; + skill: string; +} +declare var console: { + log(msg: string): void; +} +var hello = "hello"; +var robotA: Robot = { name: "mower", skill: "mowing" }; + +function foo1({ name: nameA }: Robot) { + console.log(nameA); +} +function foo2({ name: nameB, skill: skillB }: Robot) { + console.log(nameB); +} +function foo3({ name }: Robot) { + console.log(name); +} + +foo1(robotA); +foo1({ name: "Edger", skill: "cutting edges" }); + +foo2(robotA); +foo2({ name: "Edger", skill: "cutting edges" }); + +foo3(robotA); +foo3({ name: "Edger", skill: "cutting edges" });