Skip to content

Commit

Permalink
Simplify yield expression prereq
Browse files Browse the repository at this point in the history
Co-authored-by: Dion <39664950+Dionysusnu@users.noreply.github.com>
  • Loading branch information
xethlyx and Dionysusnu committed Apr 2, 2024
1 parent 57a9e2e commit 37ce4fb
Showing 1 changed file with 1 addition and 8 deletions.
Expand Up @@ -12,14 +12,7 @@ export function transformYieldExpression(state: TransformState, node: ts.YieldEx
const expression = transformExpression(state, node.expression);
if (node.asteriskToken) {
const loopId = luau.tempId("result");
const returnValue = luau.tempId("return");

state.prereq(
luau.create(luau.SyntaxKind.VariableDeclaration, {
left: returnValue,
right: undefined,
}),
);
const returnValue = state.pushToVar(undefined, "returnValue");

state.prereq(
luau.create(luau.SyntaxKind.ForStatement, {
Expand Down

0 comments on commit 37ce4fb

Please sign in to comment.