(index: number)
| 250 | } |
| 251 | |
| 252 | public getMetatableName(index: number): string | undefined { |
| 253 | const metatableNameType = this.lua.luaL_getmetafield(this.address, index, '__name') |
| 254 | if (metatableNameType === LuaType.Nil) { |
| 255 | return undefined |
| 256 | } |
| 257 | |
| 258 | if (metatableNameType !== LuaType.String) { |
| 259 | // Pop the metafield if it's not a string |
| 260 | this.pop(1) |
| 261 | return undefined |
| 262 | } |
| 263 | |
| 264 | const name = this.lua.lua_tolstring(this.address, -1, null) |
| 265 | // This is popping the luaL_getmetafield result which only pushes with type is not nil. |
| 266 | this.pop(1) |
| 267 | |
| 268 | return name |
| 269 | } |
| 270 | |
| 271 | public getValue(index: number, inputType?: LuaType, userdata?: unknown): any { |
| 272 | index = this.lua.lua_absindex(this.address, index) |
no test coverage detected