summaryrefslogtreecommitdiff
path: root/src/ltable.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-04-18 15:20:37 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-04-18 15:20:37 +0200
commita02f4e93b92e7ebb7ef038ad151e51652b0ce84d (patch)
tree2b83cacef266ff88ca3ed8cf3f19c1a1cbea7b38 /src/ltable.js
parent924ca09e8e9ec765301868d90dd3eba98058cafb (diff)
downloadfengari-a02f4e93b92e7ebb7ef038ad151e51652b0ce84d.tar.gz
fengari-a02f4e93b92e7ebb7ef038ad151e51652b0ce84d.tar.bz2
fengari-a02f4e93b92e7ebb7ef038ad151e51652b0ce84d.zip
No more Table, just TValue with table type and Map value
Diffstat (limited to 'src/ltable.js')
-rw-r--r--src/ltable.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ltable.js b/src/ltable.js
index d3009a5..23ecc11 100644
--- a/src/ltable.js
+++ b/src/ltable.js
@@ -7,7 +7,6 @@ const lobject = require('./lobject.js');
const lua = require('./lua.js');
const CT = lua.constant_types;
const nil = require('./ldo.js').nil;
-const Table = lobject.Table;
const TValue = lobject.TValue;
@@ -42,8 +41,8 @@ const luaH_getn = function(table) {
for (let i = 0; i < len; i++) {
let key = indexes[i];
- if (!table.__index(table, key).ttisnil() // t[key] is non-nil
- && (indexes[i + 1] - key > 1 || table.__index(table, indexes[i + 1]).ttisnil())) { // gap with next key or next value is nil
+ if (!lobject.table_index(table, key).ttisnil() // t[key] is non-nil
+ && (indexes[i + 1] - key > 1 || lobject.table_index(table, indexes[i + 1]).ttisnil())) { // gap with next key or next value is nil
return indexes[i];
}
}
@@ -53,7 +52,7 @@ const luaH_getn = function(table) {
const luaH_next = function(L, table, keyI) {
let keyO = L.stack[keyI];
- let key = Table.keyValue(keyO);
+ let key = lobject.table_keyValue(keyO);
let indexes = ordered_indexes(table);
if (indexes.length === 0) return 0;