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

Fixes build forcing during Lua load error #290

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

SinisterRectus
Copy link
Member

@SinisterRectus SinisterRectus commented Jul 10, 2024

Bug introduced in #276:

if compile and isLua and name:lower() ~= 'package.lua' then
  local fn, err = load(ctx, child)
  if not fn and not options.force then
    error(err)
  else
    ctx = string.dump(fn, options.strip)
  end
end

When load fails, fn is nil. If options.force is true, string.dump is called with nil and also fails.

This change removes the attempt to call string.dump with nil. Obviously, the resulting code will not be compiled or stripped in the bundle.

@Bilal2453
Copy link
Contributor

Makes sense to me.

@squeek502 squeek502 merged commit 938eb53 into luvit:master Jul 10, 2024
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants