Don't keep poll function in environment globals when polling async functions.

This is redundant after deprecating scoped async.
Closes #281
This commit is contained in:
Alex Orlenko
2023-06-04 02:31:29 +01:00
parent 9596f2e9ee
commit 8ab0ccf11c
2 changed files with 25 additions and 4 deletions
+2 -3
View File
@@ -2845,11 +2845,10 @@ impl Lua {
LightUserData(&ASYNC_POLL_PENDING as *const u8 as *mut c_void)
})?;
// We set `poll` variable in the env table to be able to destroy upvalues
self.load(
r#"
poll = get_poll(...)
local poll, pending, yield, unpack = poll, pending, yield, unpack
local poll = get_poll(...)
local pending, yield, unpack = pending, yield, unpack
while true do
local ready, res, nres = poll()
if ready then