File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ namespace ts {
4242 let value : Expression ;
4343 if ( isDestructuringAssignment ( node ) ) {
4444 value = node . right ;
45- while ( isEmptyObjectLiteralOrArrayLiteral ( node . left ) ) {
45+ while ( isEmptyArrayLiteral ( node . left ) || isEmptyObjectLiteral ( node . left ) ) {
4646 if ( isDestructuringAssignment ( value ) ) {
4747 location = node = value ;
4848 value = node . right ;
Original file line number Diff line number Diff line change @@ -3093,15 +3093,14 @@ namespace ts {
30933093 ( node . parent . kind === SyntaxKind . PropertyAccessExpression && ( < PropertyAccessExpression > node . parent ) . name === node ) ;
30943094 }
30953095
3096- export function isEmptyObjectLiteralOrArrayLiteral ( expression : Node ) : boolean {
3097- const kind = expression . kind ;
3098- if ( kind === SyntaxKind . ObjectLiteralExpression ) {
3099- return ( < ObjectLiteralExpression > expression ) . properties . length === 0 ;
3100- }
3101- if ( kind === SyntaxKind . ArrayLiteralExpression ) {
3102- return ( < ArrayLiteralExpression > expression ) . elements . length === 0 ;
3103- }
3104- return false ;
3096+ export function isEmptyObjectLiteral ( expression : Node ) : boolean {
3097+ return expression . kind === SyntaxKind . ObjectLiteralExpression &&
3098+ ( < ObjectLiteralExpression > expression ) . properties . length === 0 ;
3099+ }
3100+
3101+ export function isEmptyArrayLiteral ( expression : Node ) : boolean {
3102+ return expression . kind === SyntaxKind . ArrayLiteralExpression &&
3103+ ( < ArrayLiteralExpression > expression ) . elements . length === 0 ;
31053104 }
31063105
31073106 export function getLocalSymbolForExportDefault ( symbol : Symbol ) {
You can’t perform that action at this time.
0 commit comments