aboutsummaryrefslogtreecommitdiff
path: root/tests/manual_register.lua
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-05-23 08:35:40 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-05-23 08:35:40 +0200
commit17ca8b54fdc0aa2df875fc7b80def4dd56959d7f (patch)
tree38cf24c341cd4165ccf58aac16eaea0725bb11ec /tests/manual_register.lua
parentd468b693d79ddb416c45669e5ca8400cbdc34e85 (diff)
downloadlanes-17ca8b54fdc0aa2df875fc7b80def4dd56959d7f.tar.gz
lanes-17ca8b54fdc0aa2df875fc7b80def4dd56959d7f.tar.bz2
lanes-17ca8b54fdc0aa2df875fc7b80def4dd56959d7f.zip
on_state_create receives a string argument, "lane" or "keeper"
Diffstat (limited to 'tests/manual_register.lua')
-rw-r--r--tests/manual_register.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/manual_register.lua b/tests/manual_register.lua
index 23b33c1..a8f2098 100644
--- a/tests/manual_register.lua
+++ b/tests/manual_register.lua
@@ -1,7 +1,7 @@
1 1
2local register_func = true 2local register_func = true
3 3
4local RequireAModuleThatExportsGlobalFunctions = function() 4local RequireAModuleThatExportsGlobalFunctions = function(type_)
5 -- grab some module that exports C functions, this is good enough for our purpose 5 -- grab some module that exports C functions, this is good enough for our purpose
6 local lfs = require "lfs" 6 local lfs = require "lfs"
7 -- make one of these a global 7 -- make one of these a global
@@ -11,14 +11,14 @@ local RequireAModuleThatExportsGlobalFunctions = function()
11 if register_func then 11 if register_func then
12 lanes.register( "GlobalFunc", GlobalFunc) 12 lanes.register( "GlobalFunc", GlobalFunc)
13 end 13 end
14 print("RequireAModuleThatExportsGlobalFunctions done:", lanes.nameof(GlobalFunc)) 14 print(type_, "RequireAModuleThatExportsGlobalFunctions done:", lanes.nameof(GlobalFunc))
15end 15end
16 16
17 17
18local lanes = require "lanes".configure{ with_timers = false, on_state_create = RequireAModuleThatExportsGlobalFunctions} 18local lanes = require "lanes".configure{ with_timers = false, on_state_create = RequireAModuleThatExportsGlobalFunctions}
19 19
20-- load some module that adds C functions to the global space 20-- load some module that adds C functions to the global space
21RequireAModuleThatExportsGlobalFunctions() 21RequireAModuleThatExportsGlobalFunctions("main")
22 22
23local GlobalFuncUpval = GlobalFunc 23local GlobalFuncUpval = GlobalFunc
24 24