We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 635d271 commit 2836859Copy full SHA for 2836859
src/transformation/visitors/function.ts
@@ -143,12 +143,8 @@ export function transformFunctionBodyHeader(
143
144
// Push spread operator here
145
if (spreadIdentifier && isRestParameterReferenced(spreadIdentifier, bodyScope)) {
146
- let spreadTable: lua.Expression;
147
- if (context.luaTarget === LuaTarget.Lua50) {
148
- spreadTable = lua.createArgLiteral();
149
- } else {
150
- spreadTable = wrapInTable(lua.createDotsLiteral());
151
- }
+ const spreadTable =
+ context.luaTarget === LuaTarget.Lua50 ? lua.createArgLiteral() : wrapInTable(lua.createDotsLiteral());
152
headerStatements.push(lua.createVariableDeclarationStatement(spreadIdentifier, spreadTable));
153
}
154
0 commit comments