diff options
author | daurnimator <quae@daurnimator.com> | 2017-04-27 02:19:36 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-04-27 02:32:25 +1000 |
commit | 67cc12f149135d7a5091ce138d3fa96e71da1f69 (patch) | |
tree | 00f4548127e447da27b0d7ccfb263564f974da92 /src | |
parent | b41aad71a6b0d742cb83c16bcf53c0383de8d77e (diff) | |
download | fengari-67cc12f149135d7a5091ce138d3fa96e71da1f69.tar.gz fengari-67cc12f149135d7a5091ce138d3fa96e71da1f69.tar.bz2 fengari-67cc12f149135d7a5091ce138d3fa96e71da1f69.zip |
src/ldo: On non-lua originating error, return the js error as a lightuserdata
Diffstat (limited to 'src')
-rw-r--r-- | src/ldo.js | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -297,7 +297,11 @@ const luaD_rawrunprotected = function(L, f, ud) { try { f(L, ud); } catch (e) { - if (lj.status === 0) lj.status = -1; + if (lj.status === 0) { + lj.status = -1; + /* error was not thrown via luaD_throw; push error object as light user data */ + lapi.lua_pushlightuserdata(L, e); + } } L.errorJmp = lj.previous; |