mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
Optimize spread to not generate x.slice() when x is an array literal
This commit is contained in:
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()");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user