fix(cache): remove dependency on jit

This commit is contained in:
Folke Lemaitre 2023-03-15 08:53:19 +01:00
parent 5b7b8c5149
commit 942c805b84
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 2 additions and 1 deletions

View File

@ -170,7 +170,8 @@ end
---@private ---@private
function Cache.loader_lib(modname) function Cache.loader_lib(modname)
local start = uv.hrtime() local start = uv.hrtime()
local modpath = M.find(modname, { patterns = jit.os:find("Windows") and { ".dll" } or { ".so" } }) local is_win = uv.os_uname().sysname:lower():find("win", 1, true)
local modpath = M.find(modname, { patterns = is_win and { ".dll" } or { ".so" } })
---@type function?, string? ---@type function?, string?
if modpath then if modpath then
-- Making function name in Lua 5.1 (see src/loadlib.c:mkfuncname) is -- Making function name in Lua 5.1 (see src/loadlib.c:mkfuncname) is