Skip to content

Comments

Fixes build forcing during Lua load error#290

Merged
squeek502 merged 1 commit intoluvit:masterfrom
SinisterRectus:fix-force
Jul 10, 2024
Merged

Fixes build forcing during Lua load error#290
squeek502 merged 1 commit intoluvit:masterfrom
SinisterRectus:fix-force

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
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