diff options
author | daurnimator <quae@daurnimator.com> | 2018-01-18 07:17:59 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2018-01-18 07:17:59 +1100 |
commit | ed7ac85c409ffec65aa86189f49e5d46e7a110bc (patch) | |
tree | 9a02ed29652757dcf0ebc81b7db2c7da82474ca5 /src/lvm.js | |
parent | 8bedd949c894d61284b3ddd5b3bf989b651b95f8 (diff) | |
download | fengari-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.js | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -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 */ |