aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ldo.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ldo.js b/src/ldo.js
index fa59e0b..6b37e14 100644
--- a/src/ldo.js
+++ b/src/ldo.js
@@ -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;