From 58bd4012506e6dfc92dd819d4e43acad18e8b914 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 27 Apr 2017 17:58:58 +1000 Subject: lua_State shouldn't subclass TValue --- src/lstate.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/lstate.js') diff --git a/src/lstate.js b/src/lstate.js index 1a4cbd5..349c723 100644 --- a/src/lstate.js +++ b/src/lstate.js @@ -41,10 +41,9 @@ class CallInfo { } -class lua_State extends lobject.TValue { +class lua_State { constructor() { - super(CT.LUA_TTHREAD, null); this.base_ci = new CallInfo(); // Will be populated later this.top = 0; this.ci = null; @@ -57,8 +56,6 @@ class lua_State extends lobject.TValue { this.errorJmp = null; this.nny = 1; this.errfunc = 0; - - this.value = this; } } @@ -147,7 +144,7 @@ const preinit_thread = function(L, g) { const lua_newthread = function(L) { let g = L.l_G; let L1 = new lua_State(); - L.stack[L.top++] = L1; + L.stack[L.top++] = new lobject.TValue(CT.LUA_TTHREAD, L1); assert(L.top <= L.ci.top, "stack overflow"); preinit_thread(L1, g); L1.hookmask = L.hookmask; -- cgit v1.2.3-54-g00ecf