diff options
author | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-02-13 11:39:43 +0100 |
---|---|---|
committer | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-02-13 11:44:08 +0100 |
commit | 7236b4bf648ba2fffc83d0b031766208a183e52b (patch) | |
tree | d9963576bd6cb16a72601bb92d194e9fbc33d3a4 /src/lobject.js | |
parent | 4627bb4b5c3ccc8431fbba68a78efd50ebb13909 (diff) | |
download | fengari-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.js | 4 |
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); |