tryLoad method

bool tryLoad(
  1. List<int> data
)

Similar to LuaState.load but returns false on an error instead of throwing an exception.

If loading data fails the error is pushed to the stack, errors can be any object so to retrieve it for printing use LuaState.popString.

Implementation

bool tryLoad(List<int> data) => luaL_loadstring(L, toUint8Array(data)) == 0;