Codegen: Do not subtract 0 in arguments to rest array loop

This commit is contained in:
Anton Khlynovskiy
2016-11-17 22:06:45 +03:00
parent 52ec508e27
commit 3e52f3dfe9
96 changed files with 170 additions and 168 deletions

View File

@@ -1306,7 +1306,9 @@ namespace ts {
createAssignment(
createElementAccess(
expressionName,
createSubtract(temp, createLiteral(restIndex))
restIndex === 0
? temp
: createSubtract(temp, createLiteral(restIndex))
),
createElementAccess(createIdentifier("arguments"), temp)
),