From 4e702e5771deae24f7041088825596b02e484251 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 21 Dec 2015 11:39:05 -0800 Subject: [PATCH] Implement breakpoints in paramters with destructuring binding pattern --- src/services/breakpoints.ts | 24 ++++++++++---- ...uringParameterArrayBindingPattern.baseline | 16 +++++----- ...ringParameterArrayBindingPattern2.baseline | 16 +++++----- ...rArrayBindingPatternDefaultValues.baseline | 28 +++------------- ...ArrayBindingPatternDefaultValues2.baseline | 18 +++-------- ...rameterNestedObjectBindingPattern.baseline | 12 +++---- ...ObjectBindingPatternDefaultValues.baseline | 32 ++----------------- ...ringParameterObjectBindingPattern.baseline | 12 +++---- ...ObjectBindingPatternDefaultValues.baseline | 21 ++---------- 9 files changed, 59 insertions(+), 120 deletions(-) diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index 94fbcb785e8..5b6647e4338 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -287,11 +287,15 @@ namespace ts.BreakpointResolver { return spanInPreviousNode(node); } - // initializer of variable declaration go to previous node - if (node.parent.kind === SyntaxKind.VariableDeclaration && - ((node.parent).initializer === node || - isAssignmentOperator(node.kind))) { - return spanInPreviousNode(node); + // initializer of variable/parameter declaration go to previous node + if ((node.parent.kind === SyntaxKind.VariableDeclaration || + node.parent.kind === SyntaxKind.Parameter)) { + const paramOrVarDecl = node.parent; + if (paramOrVarDecl.initializer === node || + paramOrVarDecl.type === node || + isAssignmentOperator(node.kind)) { + return spanInPreviousNode(node); + } } // Default go to parent to set the breakpoint @@ -345,7 +349,11 @@ namespace ts.BreakpointResolver { } function spanInParameterDeclaration(parameter: ParameterDeclaration): TextSpan { - if (canHaveSpanInParameterDeclaration(parameter)) { + if (isBindingPattern(parameter.name)) { + // set breakpoint in binding pattern + return spanInBindingPattern(parameter.name); + } + else if (canHaveSpanInParameterDeclaration(parameter)) { return textSpan(parameter); } else { @@ -562,7 +570,9 @@ namespace ts.BreakpointResolver { function spanInColonToken(node: Node): TextSpan { // Is this : specifying return annotation of the function declaration - if (isFunctionLike(node.parent) || node.parent.kind === SyntaxKind.PropertyAssignment) { + if (isFunctionLike(node.parent) || + node.parent.kind === SyntaxKind.PropertyAssignment || + node.parent.kind === SyntaxKind.Parameter) { return spanInPreviousNode(node); } diff --git a/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern.baseline index c0738652a8e..03f0ee87356 100644 --- a/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern.baseline +++ b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern.baseline @@ -28,12 +28,12 @@ >:=> (line 7, col 4) to (line 7, col 22) 6 >function foo1([, nameA]: Robot) { - ~~~~~~~~~ => Pos: (147 to 155) SpanInfo: {"start":150,"length":5} + ~~~~~~~~~~~~~~~~~ => Pos: (147 to 163) SpanInfo: {"start":150,"length":5} >nameA >:=> (line 6, col 17) to (line 6, col 22) 6 >function foo1([, nameA]: Robot) { - ~~~~~~~~~~~ => Pos: (156 to 166) SpanInfo: {"start":171,"length":18} + ~~~ => Pos: (164 to 166) SpanInfo: {"start":171,"length":18} >console.log(nameA) >:=> (line 7, col 4) to (line 7, col 22) -------------------------------- @@ -56,12 +56,12 @@ >:=> (line 10, col 4) to (line 10, col 24) 9 >function foo2([numberB]: Robot) { - ~~~~~~~~~ => Pos: (207 to 215) SpanInfo: {"start":208,"length":7} + ~~~~~~~~~~~~~~~~~ => Pos: (207 to 223) SpanInfo: {"start":208,"length":7} >numberB >:=> (line 9, col 15) to (line 9, col 22) 9 >function foo2([numberB]: Robot) { - ~~~~~~~~~~~ => Pos: (216 to 226) SpanInfo: {"start":231,"length":20} + ~~~ => Pos: (224 to 226) SpanInfo: {"start":231,"length":20} >console.log(numberB) >:=> (line 10, col 4) to (line 10, col 24) -------------------------------- @@ -94,12 +94,12 @@ >:=> (line 12, col 25) to (line 12, col 31) 12 >function foo3([numberA2, nameA2, skillA2]: Robot) { - ~~~~~~~~~ => Pos: (287 to 295) SpanInfo: {"start":288,"length":7} + ~~~~~~~~~~~~~~~~~=> Pos: (287 to 303) SpanInfo: {"start":288,"length":7} >skillA2 >:=> (line 12, col 33) to (line 12, col 40) 12 >function foo3([numberA2, nameA2, skillA2]: Robot) { - ~~~~~~~~~~~=> Pos: (296 to 306) SpanInfo: {"start":311,"length":19} + ~~~=> Pos: (304 to 306) SpanInfo: {"start":311,"length":19} >console.log(nameA2) >:=> (line 13, col 4) to (line 13, col 23) -------------------------------- @@ -127,12 +127,12 @@ >:=> (line 15, col 15) to (line 15, col 23) 15 >function foo4([numberA3, ...robotAInfo]: Robot) { - ~~~~~~~~~~~~~~~ => Pos: (358 to 372) SpanInfo: {"start":359,"length":13} + ~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (358 to 380) SpanInfo: {"start":359,"length":13} >...robotAInfo >:=> (line 15, col 25) to (line 15, col 38) 15 >function foo4([numberA3, ...robotAInfo]: Robot) { - ~~~~~~~~~~~=> Pos: (373 to 383) SpanInfo: {"start":388,"length":23} + ~~~=> Pos: (381 to 383) SpanInfo: {"start":388,"length":23} >console.log(robotAInfo) >:=> (line 16, col 4) to (line 16, col 27) -------------------------------- diff --git a/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern2.baseline b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern2.baseline index 254e3a16bb0..cb9088c99ef 100644 --- a/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern2.baseline +++ b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPattern2.baseline @@ -28,12 +28,12 @@ >:=> (line 7, col 4) to (line 7, col 23) 6 >function foo1([, skillA]: Robot) { - ~~~~~~~~~~ => Pos: (162 to 171) SpanInfo: {"start":165,"length":6} + ~~~~~~~~~~~~~~~~~~ => Pos: (162 to 179) SpanInfo: {"start":165,"length":6} >skillA >:=> (line 6, col 17) to (line 6, col 23) 6 >function foo1([, skillA]: Robot) { - ~~~~~~~~~~~ => Pos: (172 to 182) SpanInfo: {"start":187,"length":19} + ~~~ => Pos: (180 to 182) SpanInfo: {"start":187,"length":19} >console.log(skillA) >:=> (line 7, col 4) to (line 7, col 23) -------------------------------- @@ -56,12 +56,12 @@ >:=> (line 10, col 4) to (line 10, col 23) 9 >function foo2([nameMB]: Robot) { - ~~~~~~~~ => Pos: (224 to 231) SpanInfo: {"start":225,"length":6} + ~~~~~~~~~~~~~~~~ => Pos: (224 to 239) SpanInfo: {"start":225,"length":6} >nameMB >:=> (line 9, col 15) to (line 9, col 21) 9 >function foo2([nameMB]: Robot) { - ~~~~~~~~~~~ => Pos: (232 to 242) SpanInfo: {"start":247,"length":19} + ~~~ => Pos: (240 to 242) SpanInfo: {"start":247,"length":19} >console.log(nameMB) >:=> (line 10, col 4) to (line 10, col 23) -------------------------------- @@ -99,12 +99,12 @@ >:=> (line 12, col 39) to (line 12, col 54) 12 >function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { - ~=> Pos: (325 to 325) SpanInfo: {"start":293,"length":32} + ~~~~~~~~~=> Pos: (325 to 333) SpanInfo: {"start":293,"length":32} >[primarySkillA, secondarySkillA] >:=> (line 12, col 23) to (line 12, col 55) 12 >function foo3([nameMA, [primarySkillA, secondarySkillA]]: Robot) { - ~~~~~~~~~~~=> Pos: (326 to 336) SpanInfo: {"start":341,"length":19} + ~~~=> Pos: (334 to 336) SpanInfo: {"start":341,"length":19} >console.log(nameMA) >:=> (line 13, col 4) to (line 13, col 23) -------------------------------- @@ -127,12 +127,12 @@ >:=> (line 16, col 4) to (line 16, col 32) 15 >function foo4([...multiRobotAInfo]: Robot) { - ~~~~~~~~~~~~~~~~~~~~ => Pos: (378 to 397) SpanInfo: {"start":379,"length":18} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (378 to 405) SpanInfo: {"start":379,"length":18} >...multiRobotAInfo >:=> (line 15, col 15) to (line 15, col 33) 15 >function foo4([...multiRobotAInfo]: Robot) { - ~~~~~~~~~~~ => Pos: (398 to 408) SpanInfo: {"start":413,"length":28} + ~~~ => Pos: (406 to 408) SpanInfo: {"start":413,"length":28} >console.log(multiRobotAInfo) >:=> (line 16, col 4) to (line 16, col 32) -------------------------------- diff --git a/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues.baseline index 4208b8de46b..d071692b0f2 100644 --- a/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues.baseline +++ b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues.baseline @@ -28,16 +28,11 @@ >:=> (line 7, col 4) to (line 7, col 22) 6 >function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { - ~~~~~~~~~~~~~~~~~~~~ => Pos: (147 to 166) SpanInfo: {"start":150,"length":16} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (147 to 198) SpanInfo: {"start":150,"length":16} >nameA = "noName" >:=> (line 6, col 17) to (line 6, col 33) 6 >function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (167 to 198) SpanInfo: {"start":147,"length":51} - >[, nameA = "noName"]: Robot = [-1, "name", "skill"] - >:=> (line 6, col 14) to (line 6, col 65) -6 >function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { - ~~~=> Pos: (199 to 201) SpanInfo: {"start":206,"length":18} >console.log(nameA) >:=> (line 7, col 4) to (line 7, col 22) @@ -61,16 +56,11 @@ >:=> (line 10, col 4) to (line 10, col 24) 9 >function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { - ~~~~~~~~~~~~~~ => Pos: (242 to 255) SpanInfo: {"start":243,"length":12} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (242 to 287) SpanInfo: {"start":243,"length":12} >numberB = -1 >:=> (line 9, col 15) to (line 9, col 27) 9 >function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (256 to 287) SpanInfo: {"start":242,"length":45} - >[numberB = -1]: Robot = [-1, "name", "skill"] - >:=> (line 9, col 14) to (line 9, col 59) -9 >function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { - ~~~=> Pos: (288 to 290) SpanInfo: {"start":295,"length":20} >console.log(numberB) >:=> (line 10, col 4) to (line 10, col 24) @@ -104,16 +94,11 @@ >:=> (line 12, col 30) to (line 12, col 45) 12 >function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { - ~~~~~~~~~~~~~~~~~~~=> Pos: (365 to 383) SpanInfo: {"start":366,"length":17} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (365 to 415) SpanInfo: {"start":366,"length":17} >skillA2 = "skill" >:=> (line 12, col 47) to (line 12, col 64) 12 >function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (384 to 415) SpanInfo: {"start":333,"length":82} - >[numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"] - >:=> (line 12, col 14) to (line 12, col 96) -12 >function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, "name", "skill"]) { - ~~~=> Pos: (416 to 418) SpanInfo: {"start":423,"length":19} >console.log(nameA2) >:=> (line 13, col 4) to (line 13, col 23) @@ -142,16 +127,11 @@ >:=> (line 15, col 15) to (line 15, col 28) 15 >function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { - ~~~~~~~~~~~~~~~ => Pos: (475 to 489) SpanInfo: {"start":476,"length":13} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (475 to 521) SpanInfo: {"start":476,"length":13} >...robotAInfo >:=> (line 15, col 30) to (line 15, col 43) 15 >function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (490 to 521) SpanInfo: {"start":460,"length":61} - >[numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"] - >:=> (line 15, col 14) to (line 15, col 75) -15 >function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { - ~~~=> Pos: (522 to 524) SpanInfo: {"start":529,"length":23} >console.log(robotAInfo) >:=> (line 16, col 4) to (line 16, col 27) diff --git a/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues2.baseline b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues2.baseline index b2c63f3b2be..34b41cc1218 100644 --- a/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues2.baseline +++ b/tests/baselines/reference/bpSpanDestructuringParameterArrayBindingPatternDefaultValues2.baseline @@ -28,16 +28,11 @@ >:=> (line 7, col 4) to (line 7, col 23) 6 >function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (154 to 188) SpanInfo: {"start":157,"length":31} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (154 to 228) SpanInfo: {"start":157,"length":31} >skillA = ["noSkill", "noSkill"] >:=> (line 6, col 17) to (line 6, col 48) 6 >function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (189 to 228) SpanInfo: {"start":154,"length":74} - >[, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]] - >:=> (line 6, col 14) to (line 6, col 88) -6 >function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "skill2"]]) { - ~~~=> Pos: (229 to 231) SpanInfo: {"start":236,"length":19} >console.log(skillA) >:=> (line 7, col 4) to (line 7, col 23) @@ -61,16 +56,11 @@ >:=> (line 10, col 4) to (line 10, col 23) 9 >function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { - ~~~~~~~~~~~~~~~~~~~ => Pos: (273 to 291) SpanInfo: {"start":274,"length":17} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (273 to 332) SpanInfo: {"start":274,"length":17} >nameMB = "noName" >:=> (line 9, col 15) to (line 9, col 32) 9 >function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (292 to 332) SpanInfo: {"start":273,"length":59} - >[nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]] - >:=> (line 9, col 14) to (line 9, col 73) -9 >function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { - ~~~=> Pos: (333 to 335) SpanInfo: {"start":340,"length":19} >console.log(nameMB) >:=> (line 10, col 4) to (line 10, col 23) @@ -122,7 +112,7 @@ >:=> (line 14, col 4) to (line 14, col 33) 15 >] = ["noSkill", "noSkill"]]: Robot) { - ~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (465 to 490) SpanInfo: {"start":397,"length":93} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (465 to 498) SpanInfo: {"start":397,"length":93} >[ > primarySkillA = "primary", > secondarySkillA = "secondary" @@ -130,7 +120,7 @@ >:=> (line 12, col 34) to (line 15, col 26) 15 >] = ["noSkill", "noSkill"]]: Robot) { - ~~~~~~~~~~~ => Pos: (491 to 501) SpanInfo: {"start":506,"length":19} + ~~~ => Pos: (499 to 501) SpanInfo: {"start":506,"length":19} >console.log(nameMA) >:=> (line 16, col 4) to (line 16, col 23) -------------------------------- diff --git a/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPattern.baseline index 3c17d60d1a4..be773df4530 100644 --- a/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPattern.baseline +++ b/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPattern.baseline @@ -67,12 +67,12 @@ >:=> (line 12, col 45) to (line 12, col 66) 12 >function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { - ~~=> Pos: (321 to 322) SpanInfo: {"start":269,"length":52} + ~~~~~~~~~~=> Pos: (321 to 330) SpanInfo: {"start":269,"length":52} >skills: { primary: primaryA, secondary: secondaryA } >:=> (line 12, col 16) to (line 12, col 68) 12 >function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) { - ~~~~~~~~~~~=> Pos: (323 to 333) SpanInfo: {"start":338,"length":21} + ~~~=> Pos: (331 to 333) SpanInfo: {"start":338,"length":21} >console.log(primaryA) >:=> (line 13, col 4) to (line 13, col 25) -------------------------------- @@ -115,12 +115,12 @@ >:=> (line 15, col 58) to (line 15, col 79) 15 >function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { - ~~=> Pos: (444 to 445) SpanInfo: {"start":392,"length":52} + ~~~~~~~~~~=> Pos: (444 to 453) SpanInfo: {"start":392,"length":52} >skills: { primary: primaryB, secondary: secondaryB } >:=> (line 15, col 29) to (line 15, col 81) 15 >function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) { - ~~~~~~~~~~~=> Pos: (446 to 456) SpanInfo: {"start":461,"length":23} + ~~~=> Pos: (454 to 456) SpanInfo: {"start":461,"length":23} >console.log(secondaryB) >:=> (line 16, col 4) to (line 16, col 27) -------------------------------- @@ -143,12 +143,12 @@ >:=> (line 19, col 4) to (line 19, col 31) 18 >function foo3({ skills }: Robot) { - ~~~~~~~~~~ => Pos: (502 to 511) SpanInfo: {"start":504,"length":6} + ~~~~~~~~~~~~~~~~~~ => Pos: (502 to 519) SpanInfo: {"start":504,"length":6} >skills >:=> (line 18, col 16) to (line 18, col 22) 18 >function foo3({ skills }: Robot) { - ~~~~~~~~~~~ => Pos: (512 to 522) SpanInfo: {"start":527,"length":27} + ~~~ => Pos: (520 to 522) SpanInfo: {"start":527,"length":27} >console.log(skills.primary) >:=> (line 19, col 4) to (line 19, col 31) -------------------------------- diff --git a/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPatternDefaultValues.baseline index 9dd4b8dc5b1..c06c9b56fe5 100644 --- a/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPatternDefaultValues.baseline +++ b/tests/baselines/reference/bpSpanDestructuringParameterNestedObjectBindingPatternDefaultValues.baseline @@ -102,7 +102,7 @@ -------------------------------- 18 > }: Robot = robotA) { - ~~~~~ => Pos: (446 to 450) SpanInfo: {"start":284,"length":161} + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (446 to 467) SpanInfo: {"start":284,"length":161} >skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" @@ -110,16 +110,6 @@ >:=> (line 14, col 8) to (line 17, col 60) 18 > }: Robot = robotA) { - ~~~~~~~~~~~~~~~~~ => Pos: (451 to 467) SpanInfo: {"start":274,"length":193} - >{ - > skills: { - > primary: primaryA = "primary", - > secondary: secondaryA = "secondary" - > } = { primary: "SomeSkill", secondary: "someSkill" } - > }: Robot = robotA - >:=> (line 13, col 4) to (line 18, col 21) -18 > }: Robot = robotA) { - ~~~ => Pos: (468 to 470) SpanInfo: {"start":475,"length":21} >console.log(primaryA) >:=> (line 19, col 4) to (line 19, col 25) @@ -196,7 +186,7 @@ -------------------------------- 28 > }: Robot = robotA) { - ~~~~~ => Pos: (721 to 725) SpanInfo: {"start":559,"length":161} + ~~~~~~~~~~~~~~~~~~~~~~ => Pos: (721 to 742) SpanInfo: {"start":559,"length":161} >skills: { > primary: primaryB = "primary", > secondary: secondaryB = "secondary" @@ -204,17 +194,6 @@ >:=> (line 24, col 8) to (line 27, col 60) 28 > }: Robot = robotA) { - ~~~~~~~~~~~~~~~~~ => Pos: (726 to 742) SpanInfo: {"start":519,"length":223} - >{ - > name: nameC = "name", - > skills: { - > primary: primaryB = "primary", - > secondary: secondaryB = "secondary" - > } = { primary: "SomeSkill", secondary: "someSkill" } - > }: Robot = robotA - >:=> (line 22, col 4) to (line 28, col 21) -28 > }: Robot = robotA) { - ~~~ => Pos: (743 to 745) SpanInfo: {"start":750,"length":23} >console.log(secondaryB) >:=> (line 29, col 4) to (line 29, col 27) @@ -238,16 +217,11 @@ >:=> (line 32, col 4) to (line 32, col 31) 31 >function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (791 to 852) SpanInfo: {"start":793,"length":57} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (791 to 869) SpanInfo: {"start":793,"length":57} >skills = { primary: "SomeSkill", secondary: "someSkill" } >:=> (line 31, col 16) to (line 31, col 73) 31 >function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { - ~~~~~~~~~~~~~~~~~=> Pos: (853 to 869) SpanInfo: {"start":791,"length":78} - >{ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA - >:=> (line 31, col 14) to (line 31, col 92) -31 >function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { - ~~~=> Pos: (870 to 872) SpanInfo: {"start":877,"length":27} >console.log(skills.primary) >:=> (line 32, col 4) to (line 32, col 31) diff --git a/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPattern.baseline b/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPattern.baseline index 6279328ed0c..21f11f320ab 100644 --- a/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPattern.baseline +++ b/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPattern.baseline @@ -46,12 +46,12 @@ >:=> (line 11, col 4) to (line 11, col 22) 10 >function foo1({ name: nameA }: Robot) { - ~~~~~~~~~~~~~~~ => Pos: (201 to 215) SpanInfo: {"start":203,"length":11} + ~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (201 to 223) SpanInfo: {"start":203,"length":11} >name: nameA >:=> (line 10, col 16) to (line 10, col 27) 10 >function foo1({ name: nameA }: Robot) { - ~~~~~~~~~~~ => Pos: (216 to 226) SpanInfo: {"start":231,"length":18} + ~~~ => Pos: (224 to 226) SpanInfo: {"start":231,"length":18} >console.log(nameA) >:=> (line 11, col 4) to (line 11, col 22) -------------------------------- @@ -79,12 +79,12 @@ >:=> (line 13, col 16) to (line 13, col 27) 13 >function foo2({ name: nameB, skill: skillB }: Robot) { - ~~~~~~~~~~~~~~~~ => Pos: (281 to 296) SpanInfo: {"start":282,"length":13} + ~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (281 to 304) SpanInfo: {"start":282,"length":13} >skill: skillB >:=> (line 13, col 29) to (line 13, col 42) 13 >function foo2({ name: nameB, skill: skillB }: Robot) { - ~~~~~~~~~~~=> Pos: (297 to 307) SpanInfo: {"start":312,"length":18} + ~~~=> Pos: (305 to 307) SpanInfo: {"start":312,"length":18} >console.log(nameB) >:=> (line 14, col 4) to (line 14, col 22) -------------------------------- @@ -107,12 +107,12 @@ >:=> (line 17, col 4) to (line 17, col 21) 16 >function foo3({ name }: Robot) { - ~~~~~~~~ => Pos: (348 to 355) SpanInfo: {"start":350,"length":4} + ~~~~~~~~~~~~~~~~ => Pos: (348 to 363) SpanInfo: {"start":350,"length":4} >name >:=> (line 16, col 16) to (line 16, col 20) 16 >function foo3({ name }: Robot) { - ~~~~~~~~~~~ => Pos: (356 to 366) SpanInfo: {"start":371,"length":17} + ~~~ => Pos: (364 to 366) SpanInfo: {"start":371,"length":17} >console.log(name) >:=> (line 17, col 4) to (line 17, col 21) -------------------------------- diff --git a/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPatternDefaultValues.baseline b/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPatternDefaultValues.baseline index a2392f5794c..6cb9b39c0d3 100644 --- a/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPatternDefaultValues.baseline +++ b/tests/baselines/reference/bpSpanDestructuringParameterObjectBindingPatternDefaultValues.baseline @@ -46,16 +46,11 @@ >:=> (line 11, col 4) to (line 11, col 22) 10 >function foo1({ name: nameA = "" }: Robot = { }) { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (203 to 230) SpanInfo: {"start":205,"length":24} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (203 to 244) SpanInfo: {"start":205,"length":24} >name: nameA = "" >:=> (line 10, col 16) to (line 10, col 40) 10 >function foo1({ name: nameA = "" }: Robot = { }) { - ~~~~~~~~~~~~~~=> Pos: (231 to 244) SpanInfo: {"start":203,"length":41} - >{ name: nameA = "" }: Robot = { } - >:=> (line 10, col 14) to (line 10, col 55) -10 >function foo1({ name: nameA = "" }: Robot = { }) { - ~~~=> Pos: (245 to 247) SpanInfo: {"start":252,"length":18} >console.log(nameA) >:=> (line 11, col 4) to (line 11, col 22) @@ -84,16 +79,11 @@ >:=> (line 13, col 16) to (line 13, col 40) 13 >function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (315 to 342) SpanInfo: {"start":316,"length":25} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (315 to 355) SpanInfo: {"start":316,"length":25} >skill: skillB = "noSkill" >:=> (line 13, col 42) to (line 13, col 67) 13 >function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { - ~~~~~~~~~~~~~=> Pos: (343 to 355) SpanInfo: {"start":288,"length":67} - >{ name: nameB = "", skill: skillB = "noSkill" }: Robot = {} - >:=> (line 13, col 14) to (line 13, col 81) -13 >function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { - ~~~=> Pos: (356 to 358) SpanInfo: {"start":363,"length":18} >console.log(nameB) >:=> (line 14, col 4) to (line 14, col 22) @@ -117,16 +107,11 @@ >:=> (line 17, col 4) to (line 17, col 21) 16 >function foo3({ name = "" }: Robot = {}) { - ~~~~~~~~~~~~~~~~~~~~~ => Pos: (399 to 419) SpanInfo: {"start":401,"length":17} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=> Pos: (399 to 432) SpanInfo: {"start":401,"length":17} >name = "" >:=> (line 16, col 16) to (line 16, col 33) 16 >function foo3({ name = "" }: Robot = {}) { - ~~~~~~~~~~~~~=> Pos: (420 to 432) SpanInfo: {"start":399,"length":33} - >{ name = "" }: Robot = {} - >:=> (line 16, col 14) to (line 16, col 47) -16 >function foo3({ name = "" }: Robot = {}) { - ~~~=> Pos: (433 to 435) SpanInfo: {"start":440,"length":17} >console.log(name) >:=> (line 17, col 4) to (line 17, col 21)