diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-09 15:22:28 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-09 15:22:28 +1000 |
commit | ac24f3f4368728c7e451ec7c1d2a77b3221940c0 (patch) | |
tree | 1b138a9ff767ef2e6f10363f58e03180112c642e /src/lapi.js | |
parent | dd087be6f10daf6dae87be07458dfaddb967edd1 (diff) | |
download | fengari-ac24f3f4368728c7e451ec7c1d2a77b3221940c0.tar.gz fengari-ac24f3f4368728c7e451ec7c1d2a77b3221940c0.tar.bz2 fengari-ac24f3f4368728c7e451ec7c1d2a77b3221940c0.zip |
Use 'delete' instead of setting to undefined
Diffstat (limited to 'src/lapi.js')
-rw-r--r-- | src/lapi.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lapi.js b/src/lapi.js index 89297cc..e847cec 100644 --- a/src/lapi.js +++ b/src/lapi.js @@ -281,7 +281,7 @@ const lua_pushcclosure = function(L, fn, n) { L.top -= n; while (n--) { cl.upvalue[n].setfrom(L.stack[L.top + n]) - L.stack[L.top + n] = void 0; + delete L.stack[L.top + n]; } L.stack[L.top] = new TValue(CT.LUA_TCCL, cl); @@ -369,7 +369,7 @@ const lua_setmetatable = function(L, objindex) { } } - L.stack[--L.top] = void 0; + delete L.stack[--L.top]; return true; }; @@ -393,8 +393,8 @@ const lua_seti = function(L, idx, n) { assert(L.top <= L.ci.top, "stack overflow"); lvm.settable(L, t, L.stack[L.top - 1], L.stack[L.top - 2]); /* pop value and key */ - L.stack[--L.top] = void 0; - L.stack[--L.top] = void 0; + delete L.stack[--L.top]; + delete L.stack[--L.top]; }; const lua_rawset = function(L, idx) { @@ -411,7 +411,7 @@ const lua_rawseti = function(L, idx, n) { let o = index2addr(L, idx); assert(o.ttistable(), "table expected"); ltable.luaH_setint(o.value, n, L.stack[L.top - 1]); - L.stack[--L.top] = void 0; + delete L.stack[--L.top]; }; const lua_rawsetp = function(L, idx, p) { @@ -847,7 +847,7 @@ const lua_setuservalue = function(L, idx) { let o = index2addr(L, idx); assert(L, o.ttisfulluserdata(), "full userdata expected"); o.uservalue.setfrom(L.stack[L.top - 1]); - L.stack[--L.top] = void 0; + delete L.stack[--L.top]; }; const lua_callk = function(L, nargs, nresults, ctx, k) { |