feat(Runtime): handle updated i32 returns for Scheduler::get_exit_code

This commit is contained in:
Erica Marigold 2024-04-12 15:36:14 +05:30
parent dcf560b4cf
commit 902c89acab
No known key found for this signature in database
GPG key ID: 2768CC0C23D245D1
3 changed files with 7 additions and 7 deletions

3
Cargo.lock generated
View file

@ -1489,8 +1489,7 @@ dependencies = [
[[package]] [[package]]
name = "mlua-luau-scheduler" name = "mlua-luau-scheduler"
version = "0.0.2" version = "0.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/0x5eal/mlua-luau-scheduler-exitstatus.git#22d15b36499db93c46ec381a562a3d1f440d6d02"
checksum = "a13eabdbc57fa38cf0b604d98ce3431573c79a964aac56e09c16c240d36cb1bf"
dependencies = [ dependencies = [
"async-executor", "async-executor",
"blocking", "blocking",

View file

@ -84,7 +84,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tokio = { version = "1.24", features = ["full", "tracing"] } tokio = { version = "1.24", features = ["full", "tracing"] }
os_str_bytes = { version = "7.0", features = ["conversions"] } os_str_bytes = { version = "7.0", features = ["conversions"] }
mlua-luau-scheduler = { version = "0.0.2" } mlua-luau-scheduler = { git = "https://github.com/0x5eal/mlua-luau-scheduler-exitstatus.git" }
mlua = { version = "0.9.6", features = [ mlua = { version = "0.9.6", features = [
"luau", "luau",
"luau-jit", "luau-jit",

View file

@ -91,14 +91,15 @@ impl Runtime {
None => Value::Nil.into_lua_multi(&self.lua), None => Value::Nil.into_lua_multi(&self.lua),
}? }?
.into_vec(); .into_vec();
Ok(( Ok((
sched.get_exit_code().unwrap_or({ ExitCode::from(sched.get_exit_code().unwrap_or({
if got_any_error.load(Ordering::SeqCst) { if got_any_error.load(Ordering::SeqCst) {
ExitCode::FAILURE 1
} else { } else {
ExitCode::SUCCESS 0
} }
}), }) as u8),
thread_res, thread_res,
)) ))
} }