diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-12 14:40:58 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-12 14:40:58 +1000 |
commit | f67e32773d85134a919b93a2394fcb7b585b5c6e (patch) | |
tree | 21c09ca8a4d012272ea6066d72c70551a376d434 /src/ldo.js | |
parent | 9d9deb1fb69d514b2d46e5b65c1eed34ece8ad3d (diff) | |
download | fengari-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.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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}`); } |