Skip to content

Commit

Permalink
Fix future/promise not assigning value
Browse files Browse the repository at this point in the history
  • Loading branch information
sasial-dev committed Jan 5, 2024
1 parent 03c5e5c commit d59f5e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zap/src/output/luau/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ impl<'src> ClientOutput<'src> {
self.push_line("local value = coroutine.yield()");
}
YieldType::Future => {
self.push_line("Future.new(function()");
self.push_line("local value = Future.new(function()");
self.indent();

self.push_line(&format!("event_queue[{id}][function_call_id] = coroutine.running()"));
Expand All @@ -695,7 +695,7 @@ impl<'src> ClientOutput<'src> {
self.push_line("end)");
}
YieldType::Promise => {
self.push_line("Promise.new(function(resolve)");
self.push_line("local value = Promise.new(function(resolve)");
self.indent();

self.push_line(&format!("event_queue[{id}][function_call_id] = resolve"));
Expand Down

0 comments on commit d59f5e9

Please sign in to comment.