@@ -1366,7 +1366,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
1366
1366
return true ;
1367
1367
}
1368
1368
1369
- function emitListWithSpread ( elements : Expression [ ] , multiLine : boolean , trailingComma : boolean ) {
1369
+ function emitListWithSpread ( elements : Expression [ ] , alwaysCopy : boolean , multiLine : boolean , trailingComma : boolean ) {
1370
1370
let pos = 0 ;
1371
1371
let group = 0 ;
1372
1372
let length = elements . length ;
@@ -1383,6 +1383,9 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
1383
1383
e = ( < SpreadElementExpression > e ) . expression ;
1384
1384
emitParenthesizedIf ( e , /*parenthesized*/ group === 0 && needsParenthesisForPropertyAccessOrInvocation ( e ) ) ;
1385
1385
pos ++ ;
1386
+ if ( pos === length && group === 0 && alwaysCopy ) {
1387
+ write ( ".slice()" ) ;
1388
+ }
1386
1389
}
1387
1390
else {
1388
1391
let i = pos ;
@@ -1422,7 +1425,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
1422
1425
write ( "]" ) ;
1423
1426
}
1424
1427
else {
1425
- emitListWithSpread ( elements , /*multiLine*/ ( node . flags & NodeFlags . MultiLine ) !== 0 ,
1428
+ emitListWithSpread ( elements , /*alwaysCopy*/ true , /* multiLine*/( node . flags & NodeFlags . MultiLine ) !== 0 ,
1426
1429
/*trailingComma*/ elements . hasTrailingComma ) ;
1427
1430
}
1428
1431
}
@@ -1847,7 +1850,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
1847
1850
write ( "void 0" ) ;
1848
1851
}
1849
1852
write ( ", " ) ;
1850
- emitListWithSpread ( node . arguments , /*multiLine*/ false , /*trailingComma*/ false ) ;
1853
+ emitListWithSpread ( node . arguments , /*alwaysCopy*/ false , /* multiLine*/ false , /*trailingComma*/ false ) ;
1851
1854
write ( ")" ) ;
1852
1855
}
1853
1856
0 commit comments