Repository navigation
debug: preserve call-backed functable environments - #111
Open
khaneliman wants to merge 1 commit into
Open
khaneliman wants to merge 1 commit into
khaneliman wants to merge 1 commit into
Conversation
Prefer a functor's call field over its __call dispatcher when reading or setting its environment. This keeps shared dispatchers unchanged and applies the environment to the function that executes the wrapped code. Backport to the maintained stdlib release branch, adapting the implementation to lib/std/debug.lua and the regression tests to specs/debug_spec.yaml. Current stdlib master delegates these functions to std.normalize. (cherry picked from commit 8b877b249c6f2353cae570647a17fc25464d73c5)
khaneliman
force-pushed
the
fix-release-callable-environments
branch
from
October 16, 2026 14:50
89d726a to
4737dba
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restore the
callfield's precedence over a functable's__calldispatcher in the release branch's environment functions. Changing only a shared dispatcher leaves the wrapped function in its old environment; this restores the behavior from before the environment-function backport.This backports commit
8b877b249c6f2353cae570647a17fc25464d73c5from lua-stdlib/normalize#2 usinggit cherry-pick -x, adapting the implementation and regression tests to the release branch's file layout. That canonical PR is still pending. This PR targets the maintainedreleasebranch rather thanmaster, which delegates these functions to normalize.The two added subprocess regression examples fail on the base revision and pass on Lua 5.1 through 5.5 and LuaJIT. Direct environment and module-loading checks also pass on all six. The wider debug specs retain baseline failures, and the complete suite aborts on existing spec-generation errors, so this is not a green full-suite result.