From 4350d195b636676ab55439551cc8fae5ee70fad3 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Tue, 23 May 2017 13:51:40 +0200 Subject: Add missing luaD_checkstack in luaD_hook --- tests/test-suite/ltests.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/test-suite/ltests.js b/tests/test-suite/ltests.js index 685f530..1c8fe6b 100644 --- a/tests/test-suite/ltests.js +++ b/tests/test-suite/ltests.js @@ -379,9 +379,9 @@ const sethook = function(L) { const smask = lauxlib.luaL_checkstring(L, 2); let count = lauxlib.luaL_optinteger(L, 3, 0); let mask = 0; - if (smask.indexOf('c'.charCodeAt(0))) mask |= lua.LUA_MASKCALL; - if (smask.indexOf('r'.charCodeAt(0))) mask |= lua.LUA_MASKRET; - if (smask.indexOf('l'.charCodeAt(0))) mask |= lua.LUA_MASKLINE; + if (smask.indexOf('c'.charCodeAt(0)) >= 0) mask |= lua.LUA_MASKCALL; + if (smask.indexOf('r'.charCodeAt(0)) >= 0) mask |= lua.LUA_MASKRET; + if (smask.indexOf('l'.charCodeAt(0)) >= 0) mask |= lua.LUA_MASKLINE; if (count > 0) mask |= lua.LUA_MASKCOUNT; sethookaux(L, mask, count, scpt); } -- cgit v1.2.3-70-g09d2