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/ltable.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/ltable.js')
-rw-r--r-- | src/ltable.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ltable.js b/src/ltable.js index 7ca7c4a..d5ae6e6 100644 --- a/src/ltable.js +++ b/src/ltable.js @@ -21,7 +21,10 @@ const { const { lua_assert } = require('./llimits.js'); const ldebug = require('./ldebug.js'); const lobject = require('./lobject.js'); -const lstring = require('./lstring.js'); +const { + luaS_hashlongstr, + TString +} = require('./lstring.js'); const lstate = require('./lstate.js'); /* used to prevent conflicts with lightuserdata keys */ @@ -56,7 +59,7 @@ const table_hash = function(L, key) { return key.value; case LUA_TSHRSTR: case LUA_TLNGSTR: - return lstring.luaS_hashlongstr(key.tsvalue()); + return luaS_hashlongstr(key.tsvalue()); case LUA_TLIGHTUSERDATA: { let v = key.value; switch(typeof v) { @@ -171,8 +174,8 @@ const luaH_getint = function(t, key) { }; const luaH_getstr = function(t, key) { - lua_assert(key instanceof lstring.TString); - return getgeneric(t, lstring.luaS_hashlongstr(key)); + lua_assert(key instanceof TString); + return getgeneric(t, luaS_hashlongstr(key)); }; const luaH_get = function(L, t, key) { |