Skip to content

Commit c8d8148

Browse files
committed
Run prettier
1 parent 5f25852 commit c8d8148

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

src/transformation/visitors/errors.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ export const transformTryStatement: FunctionVisitor<ts.TryStatement> = (statemen
202202
);
203203
const catchCallStatement = hasReturn
204204
? lua.createAssignmentStatement(
205-
[lua.cloneIdentifier(returnedIdentifier), lua.cloneIdentifier(returnValueIdentifier)],
206-
catchCall
207-
)
205+
[lua.cloneIdentifier(returnedIdentifier), lua.cloneIdentifier(returnValueIdentifier)],
206+
catchCall
207+
)
208208
: lua.createExpressionStatement(catchCall);
209209

210210
const catchCallFunction = lua.createFunctionExpression(lua.createBlock([catchCallStatement]));
@@ -217,11 +217,12 @@ export const transformTryStatement: FunctionVisitor<ts.TryStatement> = (statemen
217217
);
218218

219219
const notTryCondition = lua.createUnaryExpression(tryResultIdentifier, lua.SyntaxKind.NotOperator);
220-
result.push(lua.createIfStatement(notTryCondition, lua.createBlock(
221-
statement.finallyBlock
222-
? [tryCatchCallStatement]
223-
: [catchCallStatement]
224-
)));
220+
result.push(
221+
lua.createIfStatement(
222+
notTryCondition,
223+
lua.createBlock(statement.finallyBlock ? [tryCatchCallStatement] : [catchCallStatement])
224+
)
225+
);
225226
} else if (tryScope.functionReturned) {
226227
// try with return, but no catch
227228
// returnedIdentifier = lua.createIdentifier("____returned");
@@ -267,7 +268,10 @@ export const transformTryStatement: FunctionVisitor<ts.TryStatement> = (statemen
267268
} else if (statement.catchClause.block.statements.length > 0) {
268269
// Re-throw is possible only from non-empty blocks.
269270
const rethrow = lua.createExpressionStatement(
270-
lua.createCallExpression(lua.createIdentifier("error"), [rethrowIdentifier, lua.createNumericLiteral(0)])
271+
lua.createCallExpression(lua.createIdentifier("error"), [
272+
rethrowIdentifier,
273+
lua.createNumericLiteral(0),
274+
])
271275
);
272276
result.push(lua.createIfStatement(notTryCondition, lua.createBlock([rethrow])));
273277
}

0 commit comments

Comments
 (0)