Commit Graph

7 Commits

Author SHA1 Message Date
Max Cahill
b6ca4c7740
Merge pull request #53 from idbrii/fix-async-lovejs
async: Skip wrapping with xpcall under lovejs
2022-03-07 10:50:36 +11:00
David Briscoe
a030a20985 async: Assert that args is a table; add type_or_nil
If args is valid, assert it's a table.

Provides a clear and immediate error message when you convert
add_timeout() to call().

Also add type_or_nil. Very useful for optional parameters like this one.
Seems clearer than checking the arg first:
    if args then assert:type() end
2022-03-06 00:25:24 -08:00
David Briscoe
a5ebc1e501 lint: Fix shadow issues
Fix shadowing by using variables with a different name or _.

I don't think any of these warnings were actual bugs and fixed them to
maintain the same behaviour.
2022-03-03 10:17:34 -08:00
Max Cahill
591ba1d7a9 [added] assert methods return first argument so they can be used inline 2020-05-29 16:20:26 +10:00
Max Cahill
1610092bd1 [modified] renamed assert:equals to assert:equal for consistency
[added] assert:not_equal
2020-05-19 13:01:56 +10:00
Max Cahill
a367d18b51 [added] assert:some for nil checks 2020-05-19 13:00:23 +10:00
Max Cahill
cf7354d75f [added] assert module with some "nicer" assertions 2020-05-19 12:03:04 +10:00