summaryrefslogtreecommitdiff
path: root/src/lstate.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-01-18 04:54:49 +1100
committerdaurnimator <quae@daurnimator.com>2018-01-18 07:07:48 +1100
commitd6de63efbbc9aae1866953db4c480560e00a9032 (patch)
treed7c0876ca5229b8af9d710eb61c867ed81b89860 /src/lstate.js
parentce5bdbdb3397ac1dceab00ffb253e132db8d276b (diff)
downloadfengari-d6de63efbbc9aae1866953db4c480560e00a9032.tar.gz
fengari-d6de63efbbc9aae1866953db4c480560e00a9032.tar.bz2
fengari-d6de63efbbc9aae1866953db4c480560e00a9032.zip
src/lstate.js: Use api_incr_top instead of assert
Diffstat (limited to 'src/lstate.js')
-rw-r--r--src/lstate.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/lstate.js b/src/lstate.js
index db046dc..8f76384 100644
--- a/src/lstate.js
+++ b/src/lstate.js
@@ -1,7 +1,5 @@
"use strict";
-const assert = require('assert');
-
const defs = require('./defs.js');
const lobject = require('./lobject.js');
const ldo = require('./ldo.js');
@@ -148,8 +146,7 @@ const lua_newthread = function(L) {
let g = L.l_G;
let L1 = new lua_State(g);
L.stack[L.top] = new lobject.TValue(CT.LUA_TTHREAD, L1);
- L.top++;
- assert(L.top <= L.ci.top, "stack overflow");
+ lapi.api_incr_top(L);
L1.hookmask = L.hookmask;
L1.basehookcount = L.basehookcount;
L1.hook = L.hook;