summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-24 16:43:47 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-27 22:14:52 +1000
commit35754b22d6130971a9d0b51177bfcb7c401bb196 (patch)
tree5d3b8ba53ec5d7d589df69ab150ae8bd376f4f38
parentbb6dc6106cd1d9aedc0e9554928da6d232309a1a (diff)
downloadfengari-35754b22d6130971a9d0b51177bfcb7c401bb196.tar.gz
fengari-35754b22d6130971a9d0b51177bfcb7c401bb196.tar.bz2
fengari-35754b22d6130971a9d0b51177bfcb7c401bb196.zip
src/lobject.js: Introduce TValue.set*value for missing types
-rw-r--r--src/lobject.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lobject.js b/src/lobject.js
index 54d4de9..aec7109 100644
--- a/src/lobject.js
+++ b/src/lobject.js
@@ -161,6 +161,31 @@ class TValue {
this.value = x;
}
+ setsvalue(x) {
+ this.type = CT.LUA_TLNGSTR; /* LUA_TSHRSTR? */
+ this.value = x;
+ }
+
+ setuvalue(x) {
+ this.type = CT.LUA_TUSERDATA;
+ this.value = x;
+ }
+
+ setthvalue(x) {
+ this.type = CT.LUA_TTHREAD;
+ this.value = x;
+ }
+
+ setclLvalue(x) {
+ this.type = CT.LUA_TLCL;
+ this.value = x;
+ }
+
+ setclCvalue(x) {
+ this.type = CT.LUA_TCCL;
+ this.value = x;
+ }
+
sethvalue(x) {
this.type = CT.LUA_TTABLE;
this.value = x;