-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
Milestone
Description
Compare Cobalt:
> string.sub(false)
stdin:1: bad argument: number expected, got booleanwith PUC Lua:
> string.sub(false)
stdin:1: bad argument #1 to 'sub' (string expected, got boolean)The latter is obviously much more descriptive and useful. There's two things we should be doing here:
- Keeping argument indexes in the error message.
- Include error messages. See
luaL_argerrorfor how it's done by Lua, but it's not entirely clear this is correct in the presence of tailcalls - we may need some additional sanity checks.
Also worth thinking about how, if at all, we can expose this to CC.