From d59f5e9617a5ad3bf12d9e4f5d3d7bb4441cbf06 Mon Sep 17 00:00:00 2001 From: Sasial <44125644+sasial-dev@users.noreply.github.com> Date: Sat, 6 Jan 2024 08:05:49 +1000 Subject: [PATCH] Fix future/promise not assigning value --- zap/src/output/luau/client.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zap/src/output/luau/client.rs b/zap/src/output/luau/client.rs index 2cc69c67..ecee06d1 100644 --- a/zap/src/output/luau/client.rs +++ b/zap/src/output/luau/client.rs @@ -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()")); @@ -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"));