@@ -261,9 +261,12 @@ namespace ts.BreakpointResolver {
261261 }
262262
263263 // Set breakpoint on identifier element of destructuring pattern
264- // a or ...c from
265- // [a, b, ...c] or { a, b } from destructuring pattern
266- if ( ( node . kind === SyntaxKind . Identifier || node . kind == SyntaxKind . SpreadElementExpression ) &&
264+ // a or ...c or d: x from
265+ // [a, b, ...c] or { a, b } or { d: x } from destructuring pattern
266+ if ( ( node . kind === SyntaxKind . Identifier ||
267+ node . kind == SyntaxKind . SpreadElementExpression ||
268+ node . kind === SyntaxKind . PropertyAssignment ||
269+ node . kind === SyntaxKind . ShorthandPropertyAssignment ) &&
267270 isArrayLiteralOrObjectLiteralDestructuringPattern ( node . parent ) ) {
268271 return textSpan ( node ) ;
269272 }
@@ -322,12 +325,14 @@ namespace ts.BreakpointResolver {
322325 break ;
323326 }
324327 }
325-
328+
326329 // If this is name of property assignment, set breakpoint in the initializer
327- if ( node . parent . kind === SyntaxKind . PropertyAssignment && ( < PropertyDeclaration > node . parent ) . name === node ) {
330+ if ( node . parent . kind === SyntaxKind . PropertyAssignment &&
331+ ( < PropertyDeclaration > node . parent ) . name === node &&
332+ ! isArrayLiteralOrObjectLiteralDestructuringPattern ( node . parent . parent ) ) {
328333 return spanInNode ( ( < PropertyDeclaration > node . parent ) . initializer ) ;
329334 }
330-
335+
331336 // Breakpoint in type assertion goes to its operand
332337 if ( node . parent . kind === SyntaxKind . TypeAssertionExpression && ( < TypeAssertion > node . parent ) . type === node ) {
333338 return spanInNextNode ( ( < TypeAssertion > node . parent ) . type ) ;
@@ -609,6 +614,11 @@ namespace ts.BreakpointResolver {
609614
610615 // Default to parent node
611616 default :
617+ if ( isArrayLiteralOrObjectLiteralDestructuringPattern ( node . parent ) ) {
618+ // Breakpoint in last binding element or binding pattern if it contains no elements
619+ let objectLiteral = < ObjectLiteralExpression > node . parent ;
620+ return textSpan ( lastOrUndefined ( objectLiteral . properties ) || objectLiteral ) ;
621+ }
612622 return spanInNode ( node . parent ) ;
613623 }
614624 }
0 commit comments