summaryrefslogtreecommitdiff
path: root/src/lvm.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-01-18 07:17:59 +1100
committerdaurnimator <quae@daurnimator.com>2018-01-18 07:17:59 +1100
commited7ac85c409ffec65aa86189f49e5d46e7a110bc (patch)
tree9a02ed29652757dcf0ebc81b7db2c7da82474ca5 /src/lvm.js
parent8bedd949c894d61284b3ddd5b3bf989b651b95f8 (diff)
downloadfengari-ed7ac85c409ffec65aa86189f49e5d46e7a110bc.tar.gz
fengari-ed7ac85c409ffec65aa86189f49e5d46e7a110bc.tar.bz2
fengari-ed7ac85c409ffec65aa86189f49e5d46e7a110bc.zip
src/: Destructure when requiring lstring.js
Diffstat (limited to 'src/lvm.js')
-rw-r--r--src/lvm.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lvm.js b/src/lvm.js
index d0917b0..0f184a1 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -85,7 +85,11 @@ const {
const lobject = require('./lobject.js');
const lfunc = require('./lfunc.js');
const lstate = require('./lstate.js');
-const lstring = require('./lstring.js');
+const {
+ luaS_bless,
+ luaS_eqlngstr,
+ luaS_hashlongstr
+} = require('./lstring.js');
const ldo = require('./ldo.js');
const ltm = require('./ltm.js');
const ltable = require('./ltable.js');
@@ -762,7 +766,7 @@ const luaV_equalobj = function(L, t1, t2) {
return t1.value === t2.value ? 1 : 0;
case LUA_TSHRSTR:
case LUA_TLNGSTR: {
- return lstring.luaS_eqlngstr(t1.tsvalue(), t2.tsvalue()) ? 1 : 0;
+ return luaS_eqlngstr(t1.tsvalue(), t2.tsvalue()) ? 1 : 0;
}
case LUA_TUSERDATA:
case LUA_TTABLE:
@@ -880,8 +884,8 @@ const LEnum = function(l, r) {
** -larger than zero if 'ls' is smaller-equal-larger than 'rs'.
*/
const l_strcmp = function(ls, rs) {
- let l = lstring.luaS_hashlongstr(ls);
- let r = lstring.luaS_hashlongstr(rs);
+ let l = luaS_hashlongstr(ls);
+ let r = luaS_hashlongstr(rs);
/* In fengari we assume string hash has same collation as byte values */
if (l === r)
return 0;
@@ -1060,7 +1064,7 @@ const luaV_concat = function(L, total) {
}
let buff = new Uint8Array(tl);
copy2buff(L, top, n, buff);
- let ts = lstring.luaS_bless(L, buff);
+ let ts = luaS_bless(L, buff);
lobject.setsvalue2s(L, top - n, ts);
}
total -= n - 1; /* got 'n' strings to create 1 new */