aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-06-19 11:17:15 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-06-19 11:17:15 +0200
commit1ca04d529a447341268cb92022e36abb09fe1315 (patch)
tree2095898d26db2ed6865bf60a28c78eadc937b920 /tests
parentad7a8a8a8f9f762ce9952e0e2cea98e73ac2b32e (diff)
downloadlanes-1ca04d529a447341268cb92022e36abb09fe1315.tar.gz
lanes-1ca04d529a447341268cb92022e36abb09fe1315.tar.bz2
lanes-1ca04d529a447341268cb92022e36abb09fe1315.zip
Fix on_state_create incorrectly rejecting Lua functions with only _ENV as upvalue
Diffstat (limited to 'tests')
-rw-r--r--tests/manual_register.lua9
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/manual_register.lua b/tests/manual_register.lua
index a8f2098..5220cf8 100644
--- a/tests/manual_register.lua
+++ b/tests/manual_register.lua
@@ -1,6 +1,3 @@
1
2local register_func = true
3
4local RequireAModuleThatExportsGlobalFunctions = function(type_) 1local RequireAModuleThatExportsGlobalFunctions = function(type_)
5 -- grab some module that exports C functions, this is good enough for our purpose 2 -- grab some module that exports C functions, this is good enough for our purpose
6 local lfs = require "lfs" 3 local lfs = require "lfs"
@@ -8,14 +5,12 @@ local RequireAModuleThatExportsGlobalFunctions = function(type_)
8 GlobalFunc = lfs.attributes 5 GlobalFunc = lfs.attributes
9 -- we need to register it so that it is transferable 6 -- we need to register it so that it is transferable
10 local lanes = require "lanes" 7 local lanes = require "lanes"
11 if register_func then 8 lanes.register( "GlobalFunc", GlobalFunc)
12 lanes.register( "GlobalFunc", GlobalFunc)
13 end
14 print(type_, "RequireAModuleThatExportsGlobalFunctions done:", lanes.nameof(GlobalFunc)) 9 print(type_, "RequireAModuleThatExportsGlobalFunctions done:", lanes.nameof(GlobalFunc))
15end 10end
16 11
17 12
18local lanes = require "lanes".configure{ with_timers = false, on_state_create = RequireAModuleThatExportsGlobalFunctions} 13local lanes = require "lanes".configure{on_state_create = RequireAModuleThatExportsGlobalFunctions}
19 14
20-- load some module that adds C functions to the global space 15-- load some module that adds C functions to the global space
21RequireAModuleThatExportsGlobalFunctions("main") 16RequireAModuleThatExportsGlobalFunctions("main")