(thread: Thread, index: number, seenMap: Map<number, TableType>, table: TableType)
| 107 | } |
| 108 | |
| 109 | private readTableValues(thread: Thread, index: number, seenMap: Map<number, TableType>, table: TableType): void { |
| 110 | const isArray = Array.isArray(table) |
| 111 | |
| 112 | thread.lua.lua_pushnil(thread.address) |
| 113 | while (thread.lua.lua_next(thread.address, index)) { |
| 114 | const key = thread.indexToString(-2) |
| 115 | const value = thread.getValue(-1, undefined, seenMap) |
| 116 | |
| 117 | if (isArray) { |
| 118 | table.push(value) |
| 119 | } else { |
| 120 | table[key] = value |
| 121 | } |
| 122 | |
| 123 | thread.pop() |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | export default function createTypeExtension(thread: Global): TypeExtension<any> { |
no test coverage detected