diff options
author | Benoit Giannangeli <giann008@gmail.com> | 2017-03-12 10:23:11 +0100 |
---|---|---|
committer | Benoit Giannangeli <giann@users.noreply.github.com> | 2017-03-13 11:03:24 +0100 |
commit | 52fa5f8a97fd5322fcb110298c4ce14328074818 (patch) | |
tree | fbfb7f43039885491a87bdfc71f21a73e3dfbe25 /src/lobject.js | |
parent | e96d75a87d879f7f455e4b9c6457bf6580743fa5 (diff) | |
download | fengari-52fa5f8a97fd5322fcb110298c4ce14328074818.tar.gz fengari-52fa5f8a97fd5322fcb110298c4ce14328074818.tar.bz2 fengari-52fa5f8a97fd5322fcb110298c4ce14328074818.zip |
[Strings] lvm.js
Diffstat (limited to 'src/lobject.js')
-rw-r--r-- | src/lobject.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lobject.js b/src/lobject.js index 3d9edb0..92dd560 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -124,14 +124,15 @@ class Table extends TValue { static keyValue(key) { // Those lua values are used by value, others by reference - if (key instanceof TValue - && [CT.LUA_TNIL, + if (key instanceof TValue) { + if ([CT.LUA_TNIL, CT.LUA_TBOOLEAN, CT.LUA_TSTRING, - CT.LUA_TSHRSTR, - CT.LUA_TLNGSTR, CT.LUA_TNUMINT].indexOf(key.type) > -1) { - key = key.value; + key = key.value; + } else if ([CT.LUA_TSHRSTR, CT.LUA_TLNGSTR].indexOf(key.type) > -1) { + key = key.value.map(e => `${e}|`).join(''); + } } return key; |