Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change chunk env to use luau's lua_load env parameter #442

Merged
merged 1 commit into from
Aug 25, 2024

Conversation

bjcscat
Copy link
Contributor

@bjcscat bjcscat commented Aug 21, 2024

Luau provides a parameter to lua_load which is a stack index for the environment which a chunk should be loaded with.

Using this over setfenv is preferred as setfenv impacts or entirely impedes Luau's JIT compilation.

This should also be backported to v0.9

@khvzak khvzak changed the base branch from main to pr-442 August 25, 2024 15:50
@khvzak khvzak merged commit 7bfd327 into mlua-rs:pr-442 Aug 25, 2024
127 of 128 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants