From 1ca04d529a447341268cb92022e36abb09fe1315 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Wed, 19 Jun 2024 11:17:15 +0200 Subject: Fix on_state_create incorrectly rejecting Lua functions with only _ENV as upvalue --- tests/manual_register.lua | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'tests') 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 @@ - -local register_func = true - local RequireAModuleThatExportsGlobalFunctions = function(type_) -- grab some module that exports C functions, this is good enough for our purpose local lfs = require "lfs" @@ -8,14 +5,12 @@ local RequireAModuleThatExportsGlobalFunctions = function(type_) GlobalFunc = lfs.attributes -- we need to register it so that it is transferable local lanes = require "lanes" - if register_func then - lanes.register( "GlobalFunc", GlobalFunc) - end + lanes.register( "GlobalFunc", GlobalFunc) print(type_, "RequireAModuleThatExportsGlobalFunctions done:", lanes.nameof(GlobalFunc)) end -local lanes = require "lanes".configure{ with_timers = false, on_state_create = RequireAModuleThatExportsGlobalFunctions} +local lanes = require "lanes".configure{on_state_create = RequireAModuleThatExportsGlobalFunctions} -- load some module that adds C functions to the global space RequireAModuleThatExportsGlobalFunctions("main") -- cgit v1.2.3-55-g6feb