summaryrefslogtreecommitdiff
path: root/src/lobject.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-24 16:38:03 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-27 22:14:51 +1000
commitbb6dc6106cd1d9aedc0e9554928da6d232309a1a (patch)
tree34ca5efe17417adaa8cb84d6d14c7fc622f95c93 /src/lobject.js
parentebbfaf9602a624e1c8eb39e88661fadc56996c4b (diff)
downloadfengari-bb6dc6106cd1d9aedc0e9554928da6d232309a1a.tar.gz
fengari-bb6dc6106cd1d9aedc0e9554928da6d232309a1a.tar.bz2
fengari-bb6dc6106cd1d9aedc0e9554928da6d232309a1a.zip
Introduce chgfltvalue and chgivalue
Diffstat (limited to 'src/lobject.js')
-rw-r--r--src/lobject.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lobject.js b/src/lobject.js
index ee7a51d..54d4de9 100644
--- a/src/lobject.js
+++ b/src/lobject.js
@@ -126,11 +126,21 @@ class TValue {
this.value = x;
}
+ chgfltvalue(x) {
+ assert(this.type == CT.LUA_TNUMFLT);
+ this.value = x;
+ }
+
setivalue(x) {
this.type = CT.LUA_TNUMINT;
this.value = x;
}
+ chgivalue(x) {
+ assert(this.type == CT.LUA_TNUMINT);
+ this.value = x;
+ }
+
setnilvalue() {
this.type = CT.LUA_TNIL;
this.value = void 0;