summaryrefslogtreecommitdiff
path: root/src/lobject.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-13 11:39:43 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-13 11:44:08 +0100
commit7236b4bf648ba2fffc83d0b031766208a183e52b (patch)
treed9963576bd6cb16a72601bb92d194e9fbc33d3a4 /src/lobject.js
parent4627bb4b5c3ccc8431fbba68a78efd50ebb13909 (diff)
downloadfengari-7236b4bf648ba2fffc83d0b031766208a183e52b.tar.gz
fengari-7236b4bf648ba2fffc83d0b031766208a183e52b.tar.bz2
fengari-7236b4bf648ba2fffc83d0b031766208a183e52b.zip
l_isfalse as TValue method
Diffstat (limited to 'src/lobject.js')
-rw-r--r--src/lobject.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lobject.js b/src/lobject.js
index 7b39668..385ac9c 100644
--- a/src/lobject.js
+++ b/src/lobject.js
@@ -102,6 +102,10 @@ class TValue {
return this.checktag(CT.LUA_TDEADKEY);
}
+ l_isfalse() {
+ return this.ttisnil() || (this.ttisboolean() && this.value === false);
+ }
+
}
const nil = new TValue(CT.LUA_TNIL, null);