diff options
| author | Benoit Germain <bnt.germain@gmail.com> | 2025-09-20 14:30:57 +0200 |
|---|---|---|
| committer | Benoit Germain <bnt.germain@gmail.com> | 2025-09-20 14:30:57 +0200 |
| commit | c52571736d852d2636bd285d19c613be5c706cff (patch) | |
| tree | 50a1fc9b867197faa695c728008c8d0c7498b756 /src/lanes.cpp | |
| parent | dc3de6ef8d4bb1a8ce7b2932515a0f6287ab1e76 (diff) | |
| download | lanes-c52571736d852d2636bd285d19c613be5c706cff.tar.gz lanes-c52571736d852d2636bd285d19c613be5c706cff.tar.bz2 lanes-c52571736d852d2636bd285d19c613be5c706cff.zip | |
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
Diffstat (limited to 'src/lanes.cpp')
| -rw-r--r-- | src/lanes.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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_) | |||
| 907 | // will do nothing on first invocation, as we haven't stored settings in the registry yet | 907 | // will do nothing on first invocation, as we haven't stored settings in the registry yet |
| 908 | lua_setfield(L_, -3, "settings"); // L_: M LG_configure() | 908 | lua_setfield(L_, -3, "settings"); // L_: M LG_configure() |
| 909 | lua_setfield(L_, -2, "configure"); // L_: M | 909 | lua_setfield(L_, -2, "configure"); // L_: M |
| 910 | // lanes.null can be used for some configure settings, expose it now | ||
| 911 | kNilSentinel.pushKey(L_); // L_: M kNilSentinel | ||
| 912 | lua_setfield(L_, -2, "null"); // L_: M | ||
| 910 | } | 913 | } |
| 911 | 914 | ||
| 912 | STACK_CHECK(L_, 1); | 915 | STACK_CHECK(L_, 1); |
