summaryrefslogtreecommitdiff
path: root/src/ldebug.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-01-18 04:37:44 +1100
committerdaurnimator <quae@daurnimator.com>2018-01-18 07:07:44 +1100
commita6e100af7363ad5581c568bbfa9887b707b8859e (patch)
treebc839141d2dc156c5b02ed6d7b8b62fad7f60fe9 /src/ldebug.js
parent15f6a164001c629ec0e8a4d2031ece8b94298780 (diff)
downloadfengari-a6e100af7363ad5581c568bbfa9887b707b8859e.tar.gz
fengari-a6e100af7363ad5581c568bbfa9887b707b8859e.tar.bz2
fengari-a6e100af7363ad5581c568bbfa9887b707b8859e.zip
src/lapi.js: Export api_incr_top and api_checknelems
Diffstat (limited to 'src/ldebug.js')
-rw-r--r--src/ldebug.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ldebug.js b/src/ldebug.js
index 5a0e480..25a6257 100644
--- a/src/ldebug.js
+++ b/src/ldebug.js
@@ -5,6 +5,7 @@ const {
api_check,
lua_assert
} = require('./llimits.js');
+const lapi = require('./lapi.js');
const ldo = require('./ldo.js');
const lfunc = require('./lfunc.js');
const llex = require('./llex.js');
@@ -188,14 +189,12 @@ const funcinfo = function(ar, cl) {
const collectvalidlines = function(L, f) {
if (f === null || f instanceof lobject.CClosure) {
L.stack[L.top] = new lobject.TValue(CT.LUA_TNIL, null);
- L.top++;
- lua_assert(L.top <= L.ci.top, "stack overflow");
+ lapi.api_incr_top(L);
} else {
let lineinfo = f.p.lineinfo;
let t = ltable.luaH_new(L);
L.stack[L.top] = new lobject.TValue(CT.LUA_TTABLE, t);
- L.top++;
- lua_assert(L.top <= L.ci.top, "stack overflow");
+ lapi.api_incr_top(L);
let v = new lobject.TValue(CT.LUA_TBOOLEAN, true);
for (let i = 0; i < lineinfo.length; i++)
ltable.luaH_setint(t, lineinfo[i], v);