File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1935,10 +1935,18 @@ namespace ts {
19351935 case SyntaxKind . SpreadElementExpression :
19361936 case SyntaxKind . JsxSpreadAttribute :
19371937 let root = container ;
1938- while ( root && root . kind !== SyntaxKind . BinaryExpression ) {
1938+ let hasRest = false ;
1939+ while ( root . parent ) {
1940+ if ( root . kind === SyntaxKind . ObjectLiteralExpression &&
1941+ root . parent . kind === SyntaxKind . BinaryExpression &&
1942+ ( root . parent as BinaryExpression ) . operatorToken . kind === SyntaxKind . EqualsToken &&
1943+ ( root . parent as BinaryExpression ) . left === root ) {
1944+ hasRest = true ;
1945+ break ;
1946+ }
19391947 root = root . parent ;
19401948 }
1941- emitFlags |= root && isDestructuringAssignment ( root ) ? NodeFlags . HasRestAttribute : NodeFlags . HasSpreadAttribute ;
1949+ emitFlags |= hasRest ? NodeFlags . HasRestAttribute : NodeFlags . HasSpreadAttribute ;
19421950 return ;
19431951
19441952 case SyntaxKind . CallSignature :
Original file line number Diff line number Diff line change @@ -45,7 +45,6 @@ var __assign = (this && this.__assign) || Object.assign || function(t) {
4545 const restHelper = `
4646var __rest = (this && this.__rest) || function (s, e) {
4747 var t = {};
48-
4948 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && !e.indexOf(p))
5049 t[p] = s[p];
5150 return t;
You can’t perform that action at this time.
0 commit comments