gudzpoz / luajava

Lua for Java on Windows, Mac OS X, Linux, Android. 5.1, 5.2, 5.3, 5.4, LuaJ or LuaJIT.
https://gudzpoz.github.io/luajava/
Other
143 stars 17 forks source link

Explicit error messages instead of `nil` values everywhere #20

Closed gudzpoz closed 2 years ago

gudzpoz commented 2 years ago

Fixes #18.

  1. No arbitrary nil values any more. Yes, any exception will interrupt the whole program. Use pcall for simplistic try-&-catch.
  2. For JFunction, push an error message and return -1 to indicate an error. See the Javadoc for more info.
codecov-commenter commented 2 years ago

Codecov Report

Merging #20 (fe2cca7) into main (2c70a1c) will increase coverage by 0.35%. The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main      #20      +/-   ##
============================================
+ Coverage     91.63%   91.99%   +0.35%     
- Complexity      416      423       +7     
============================================
  Files            24       24              
  Lines           909      949      +40     
  Branches        116      122       +6     
============================================
+ Hits            833      873      +40     
  Misses           56       56              
  Partials         20       20              
Impacted Files Coverage Δ
...uajava/src/main/java/party/iroiro/luajava/Lua.java 100.00% <ø> (ø)
...ava/src/main/java/party/iroiro/luajava/JuaAPI.java 100.00% <100.00%> (ø)

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more