Skip to content
Discussion options

You must be logged in to vote

I could use "runtime.special": { "check": "assert" } and make utils.check global, but that is ugly.

You can use "runtime.special": { "utils.check": "assert" } then you dont need to make it global.
AFAIK it is pure string / token text matching.

But there is a caveat, if your code is something like:

local utils = require "utils"
local check = utils.check

check(...) -- this won't work, because runtime special is pure token text matching
require "utils".check(...) -- this won't work either

local u = require "utils"
u.check(...) -- wont work ...

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sewbacca
Comment options

Answer selected by sewbacca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants