Currently,
return mw.text.trim(nil)
will generate: Lua error: bad argument #1 to 'gsub' (string expected, got nil).
From a debugging perspective, this is pretty misleading, since gsub isn't used in the user-generated line of code, and there is no line number to aid the user. Are we able to either:
- make the error message refer to mw.text.trim()
- provide the offending line number as part of the error
- both?
If generalized, I'm assuming this could benefit the rest of the mw.text.* library and possibly other libraries. Original MW request here, and a related en.wiki discussion here.
