summaryrefslogtreecommitdiff
path: root/src/ldo.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-12 14:40:58 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-12 14:40:58 +1000
commitf67e32773d85134a919b93a2394fcb7b585b5c6e (patch)
tree21c09ca8a4d012272ea6066d72c70551a376d434 /src/ldo.js
parent9d9deb1fb69d514b2d46e5b65c1eed34ece8ad3d (diff)
downloadfengari-f67e32773d85134a919b93a2394fcb7b585b5c6e.tar.gz
fengari-f67e32773d85134a919b93a2394fcb7b585b5c6e.tar.bz2
fengari-f67e32773d85134a919b93a2394fcb7b585b5c6e.zip
src/ldo.js: Don't pass a 'this' to the panic function
Diffstat (limited to 'src/ldo.js')
-rw-r--r--src/ldo.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ldo.js b/src/ldo.js
index 953a3b5..23c5969 100644
--- a/src/ldo.js
+++ b/src/ldo.js
@@ -275,11 +275,12 @@ const luaD_throw = function(L, errcode) {
g.mainthread.stack[g.mainthread.top++] = L.stack[L.top - 1]; /* copy error obj. */
luaD_throw(g.mainthread, errcode); /* re-throw in main thread */
} else { /* no handler at all; abort */
- if (g.panic) { /* panic function? */
+ let panic = g.panic;
+ if (panic) { /* panic function? */
seterrorobj(L, errcode, L.top); /* assume EXTRA_STACK */
if (L.ci.top < L.top)
L.ci.top = L.top; /* pushing msg. can break this invariant */
- g.panic(L); /* call panic function (last chance to jump out) */
+ panic(L); /* call panic function (last chance to jump out) */
}
throw new Error(`Aborted ${errcode}`);
}