mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Optimize spread to not generate x.slice() when x is an array literal
This commit is contained in:
committed by
Mohamed Hegazy
parent
a4294a6864
commit
de8b2fabb9
@@ -1383,7 +1383,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
e = (<SpreadElementExpression>e).expression;
|
||||
emitParenthesizedIf(e, /*parenthesized*/ group === 0 && needsParenthesisForPropertyAccessOrInvocation(e));
|
||||
pos++;
|
||||
if (pos === length && group === 0 && alwaysCopy) {
|
||||
if (pos === length && group === 0 && alwaysCopy && e.kind !== SyntaxKind.ArrayLiteralExpression) {
|
||||
write(".slice()");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user