summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-05-25 14:34:08 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-05-25 14:34:08 +0200
commit2d39bb6c673fac9bf551e139c6ff651a0bbc734b (patch)
tree6fff109438b934cbe605676169060951bb6e0bbb
parented84714a5dc721beecae3996ebe81678d6680bf2 (diff)
downloadfengari-2d39bb6c673fac9bf551e139c6ff651a0bbc734b.tar.gz
fengari-2d39bb6c673fac9bf551e139c6ff651a0bbc734b.tar.bz2
fengari-2d39bb6c673fac9bf551e139c6ff651a0bbc734b.zip
Added missing parenthesis in luaG_traceexec on yield case
-rw-r--r--src/ldebug.js2
-rw-r--r--tests/test-suite/inprogress/coroutine.js5
2 files changed, 2 insertions, 5 deletions
diff --git a/src/ldebug.js b/src/ldebug.js
index afbb556..5749951 100644
--- a/src/ldebug.js
+++ b/src/ldebug.js
@@ -629,7 +629,7 @@ const luaG_traceexec = function(L) {
let newline = p.lineinfo.length !== 0 ? p.lineinfo[npc] : -1;
if (npc === 0 || /* call linehook when enter a new function, */
ci.l_savedpc <= L.oldpc || /* when jump back (loop), or when */
- newline !== p.lineinfo.length !== 0 ? p.lineinfo[L.oldpc - 1] : -1) /* enter a new line */
+ newline !== (p.lineinfo.length !== 0 ? p.lineinfo[L.oldpc - 1] : -1)) /* enter a new line */
ldo.luaD_hook(L, defs.LUA_HOOKLINE, newline); /* call line hook */
}
L.oldpc = ci.l_savedpc;
diff --git a/tests/test-suite/inprogress/coroutine.js b/tests/test-suite/inprogress/coroutine.js
index b026bb6..117cd2b 100644
--- a/tests/test-suite/inprogress/coroutine.js
+++ b/tests/test-suite/inprogress/coroutine.js
@@ -986,10 +986,7 @@ test("[test-suite] coroutine: testing yields inside line hook", function (t) {
-- testing yields in line hook
local co = coroutine.wrap(function ()
- T.sethook("setglobal X; yield 0", "l", 0)
- foo()
- return 10
- end)
+ T.sethook("setglobal X; yield 0", "l", 0); foo(); return 10 end)
_G.XX = nil;
_G.X = nil; co(); assert(_G.X == line)