summaryrefslogtreecommitdiff
path: root/src/lapi.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/lapi.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/lapi.js')
-rw-r--r--src/lapi.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lapi.js b/src/lapi.js
index 826dee2..7123628 100644
--- a/src/lapi.js
+++ b/src/lapi.js
@@ -270,7 +270,7 @@ const lua_pushcclosure = function(L, fn, n) {
assert(n < L.top - L.ci.funcOff, "not enough elements in the stack");
assert(n <= MAXUPVAL, "upvalue index too large");
- let cl = new CClosure(fn, n);
+ let cl = new CClosure(L, fn, n);
L.top -= n;
while (n--) {
@@ -473,6 +473,7 @@ const lua_createtable = function(L, narray, nrec) {
const luaS_newudata = function(L, size) {
return {
+ id: L.l_G.id_counter++,
metatable: null,
uservalue: null,
len: size,
@@ -693,7 +694,7 @@ const lua_topointer = function(L, idx) {
case CT.LUA_TCCL:
case CT.LUA_TLCF:
case CT.LUA_TTHREAD:
- case CT.LUA_TUSERDATA:
+ case CT.LUA_TUSERDATA: /* note: this differs in behaviour to reference lua implementation */
case CT.LUA_TLIGHTUSERDATA:
return o.value;
default: