diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-05-23 08:35:40 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-05-23 08:35:40 +0200 |
commit | 17ca8b54fdc0aa2df875fc7b80def4dd56959d7f (patch) | |
tree | 38cf24c341cd4165ccf58aac16eaea0725bb11ec /tests/manual_register.lua | |
parent | d468b693d79ddb416c45669e5ca8400cbdc34e85 (diff) | |
download | lanes-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.lua | 6 |
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 | ||
2 | local register_func = true | 2 | local register_func = true |
3 | 3 | ||
4 | local RequireAModuleThatExportsGlobalFunctions = function() | 4 | local 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)) |
15 | end | 15 | end |
16 | 16 | ||
17 | 17 | ||
18 | local lanes = require "lanes".configure{ with_timers = false, on_state_create = RequireAModuleThatExportsGlobalFunctions} | 18 | local 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 |
21 | RequireAModuleThatExportsGlobalFunctions() | 21 | RequireAModuleThatExportsGlobalFunctions("main") |
22 | 22 | ||
23 | local GlobalFuncUpval = GlobalFunc | 23 | local GlobalFuncUpval = GlobalFunc |
24 | 24 | ||