From d6de63efbbc9aae1866953db4c480560e00a9032 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 18 Jan 2018 04:54:49 +1100 Subject: src/lstate.js: Use api_incr_top instead of assert --- src/lstate.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/lstate.js') 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; -- cgit v1.2.3-54-g00ecf