From f67e32773d85134a919b93a2394fcb7b585b5c6e Mon Sep 17 00:00:00 2001 From: daurnimator Date: Fri, 12 May 2017 14:40:58 +1000 Subject: src/ldo.js: Don't pass a 'this' to the panic function --- src/ldo.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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}`); } -- cgit v1.2.3-70-g09d2