JakobOvrum/LuaD

Move getMetaTable() from LuaTable to LuaObject?

Opened this issue · 0 comments

I'm writing some code where I'd like to check the __dtype from a Lua object's metatable to check if it was made from a D type before I attempt to!() conversions. But given that class objects are (and in the future, hopefully struct references will be) Lua Userdata objects, this only works part of the time.

I've done some quick checking in my local source tree, and it seems like just moving the getMetaTable() method wholesale from LuaTable to LuaObject, and adding a quick .type() check does the trick.

Would you consider accepting a pull request to this effect?