File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1935,10 +1935,18 @@ namespace ts {
1935
1935
case SyntaxKind . SpreadElementExpression :
1936
1936
case SyntaxKind . JsxSpreadAttribute :
1937
1937
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
+ }
1939
1947
root = root . parent ;
1940
1948
}
1941
- emitFlags |= root && isDestructuringAssignment ( root ) ? NodeFlags . HasRestAttribute : NodeFlags . HasSpreadAttribute ;
1949
+ emitFlags |= hasRest ? NodeFlags . HasRestAttribute : NodeFlags . HasSpreadAttribute ;
1942
1950
return ;
1943
1951
1944
1952
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) {
45
45
const restHelper = `
46
46
var __rest = (this && this.__rest) || function (s, e) {
47
47
var t = {};
48
-
49
48
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && !e.indexOf(p))
50
49
t[p] = s[p];
51
50
return t;
You can’t perform that action at this time.
0 commit comments