aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-11 17:00:12 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-11 17:00:12 +1000
commit4405575ad986ee0ea652a069bae72d9984cb6a9f (patch)
tree7edfe2de32cf36f73991695541de52185a84a0cc /src
parent011c821b3a94c0d2fa8892696178c76aed4c2349 (diff)
downloadfengari-4405575ad986ee0ea652a069bae72d9984cb6a9f.tar.gz
fengari-4405575ad986ee0ea652a069bae72d9984cb6a9f.tar.bz2
fengari-4405575ad986ee0ea652a069bae72d9984cb6a9f.zip
src/lobject.js: Fix dead key TValue type
Diffstat (limited to 'src')
-rw-r--r--src/lobject.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lobject.js b/src/lobject.js
index e4ef380..fe23d24 100644
--- a/src/lobject.js
+++ b/src/lobject.js
@@ -13,6 +13,8 @@ const llimit = require('./llimit.js');
const CT = defs.constant_types;
const char = defs.char;
+const LUA_TPROTO = CT.LUA_NUMTAGS;
+const LUA_TDEADKEY = CT.LUA_NUMTAGS+1;
class TValue {
@@ -108,7 +110,7 @@ class TValue {
}
ttisdeadkey() {
- return this.checktag(CT.LUA_TDEADKEY);
+ return this.checktag(LUA_TDEADKEY);
}
l_isfalse() {
@@ -150,6 +152,11 @@ class TValue {
this.value = x;
}
+ setdeadvalue() {
+ this.type = LUA_TDEADKEY;
+ this.value = null;
+ }
+
setfrom(tv) { /* in lua C source setobj2t is often used for this */
this.type = tv.type;
this.value = tv.value;
@@ -539,6 +546,8 @@ const numarith = function(L, op, v1, v2) {
}
};
+module.exports.LUA_TPROTO = LUA_TPROTO;
+module.exports.LUA_TDEADKEY = LUA_TDEADKEY;
module.exports.CClosure = CClosure;
module.exports.LClosure = LClosure;
module.exports.LocVar = LocVar;