From c52571736d852d2636bd285d19c613be5c706cff Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Sat, 20 Sep 2025 14:30:57 +0200 Subject: Improve table and userdata conversions * add convert_fallback and convert_max_attempts to global settings * if no __lanesconvert is available, use convert_fallback (can be useful for externally provided full userdata with fixed metatables) * only try conversion on non-deep and non-clonable userdata * conversion can be applied recursively, up to convert_max_attempts times * plus all the relevant unit tests of course --- src/lanes.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lanes.cpp') diff --git a/src/lanes.cpp b/src/lanes.cpp index 4373aee..024ac67 100644 --- a/src/lanes.cpp +++ b/src/lanes.cpp @@ -907,6 +907,9 @@ LANES_API int luaopen_lanes_core(lua_State* const L_) // will do nothing on first invocation, as we haven't stored settings in the registry yet lua_setfield(L_, -3, "settings"); // L_: M LG_configure() lua_setfield(L_, -2, "configure"); // L_: M + // lanes.null can be used for some configure settings, expose it now + kNilSentinel.pushKey(L_); // L_: M kNilSentinel + lua_setfield(L_, -2, "null"); // L_: M } STACK_CHECK(L_, 1); -- cgit v1.2.3-55-g6feb