diff --git a/README.md b/README.md index acfabe9..1cdec3c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ljkiwi - Free LuaJIT FFI kiwi (Cassowary derived) constraint solver. -[![CI](https://github.com/jkl1337/ljkiwi/actions/workflows/ci.yml/badge.svg)](https://github.com/jkl1337/ljkiwi/actions/workflows/ci.yml) +[![CI](https://github.com/jkl1337/ljkiwi/actions/workflows/busted.yml/badge.svg)](https://github.com/jkl1337/ljkiwi/actions/workflows/busted.yml) [![Coverage Status](https://coveralls.io/repos/github/jkl1337/ljkiwi/badge.svg?branch=master)](https://coveralls.io/github/jkl1337/ljkiwi?branch=master) [![luarocks](https://img.shields.io/luarocks/v/jkl/ljkiwi)](https://luarocks.org/modules/jkl/ljkiwi) diff --git a/kiwi.lua b/kiwi.lua index 9a60ab0..f116ba7 100644 --- a/kiwi.lua +++ b/kiwi.lua @@ -871,7 +871,8 @@ do function kiwi.error_mask(kinds, invert) local mask = 0 for _, k in ipairs(kinds) do - mask = bor(mask, lshift(1, kiwi.ErrKind(k))) + -- must use tonumber only for LuaJIT 2.0 compatibility + mask = bor(mask, lshift(1, tonumber(kiwi.ErrKind(k)) --[[@as integer]])) end return invert and bit.bnot(mask) or mask end @@ -940,8 +941,9 @@ do end local errdata = new_error(kind, message, solver, item) local error_mask = solver and solver.error_mask_ or 0 + -- tonumber only required for LuaJIT 2.0 compatibility return item, - band(error_mask, lshift(1, kind --[[@as integer]])) == 0 and error(errdata) + band(error_mask, lshift(1, tonumber(kind) --[[@as integer]])) == 0 and error(errdata) or errdata end return item