summaryrefslogtreecommitdiff
path: root/src/lstate.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-03 16:11:25 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-03 16:28:01 +1000
commit48b5ebfac37a9d0e4c3622530121e28a50a38a38 (patch)
treeeb0c0af210dbc8d85acfc7b5888dbe7669ec4a81 /src/lstate.js
parentebeb17ee158a3b482bd70c8643eacd166d89b4b5 (diff)
downloadfengari-48b5ebfac37a9d0e4c3622530121e28a50a38a38.tar.gz
fengari-48b5ebfac37a9d0e4c3622530121e28a50a38a38.tar.bz2
fengari-48b5ebfac37a9d0e4c3622530121e28a50a38a38.zip
Move .id field from TValue to values themselves
Diffstat (limited to 'src/lstate.js')
-rw-r--r--src/lstate.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lstate.js b/src/lstate.js
index 1b077d2..d389419 100644
--- a/src/lstate.js
+++ b/src/lstate.js
@@ -45,6 +45,7 @@ class CallInfo {
class lua_State {
constructor() {
+ this.id = null;
this.base_ci = new CallInfo(); // Will be populated later
this.top = 0;
this.ci = null;
@@ -64,6 +65,8 @@ class lua_State {
class global_State {
constructor(L) {
+ this.id_counter = 0; /* used to give objects unique ids */
+
this.mainthread = L;
this.l_registry = new lobject.TValue(CT.LUA_TNIL, null);
this.panic = null;
@@ -123,6 +126,7 @@ const f_luaopen = function(L) {
};
const preinit_thread = function(L, g) {
+ L.id = g.id_counter++;
L.l_G = g;
L.stack = [];
L.ci = null;