rxi / lovebird

A browser-based debug console for LÖVE
MIT License
293 stars 25 forks source link

Can't inspect moonscript class instances #13

Open winterwolf opened 6 years ago

winterwolf commented 6 years ago

screenshot

As you can see on the screenshot, global table app is existed and I can get access to her fields from the command line, but at the right side it's empty.

This table was compiled from a moonscript's class instance. See example on the main page: https://moonscript.org

taxilly commented 5 years ago

Kind of the same issue, except I can't see metatables...

image

winterwolf commented 3 years ago

@taxilly you will be able to see metatables if after this line: https://github.com/rxi/lovebird/blob/e84abe7b56a65ccb3ec6288e1955b6d772d41431/lovebird.lua#L405 add this:

local mt = getmetatable(t)
if mt then
  for k, v in pairs(mt) do t["<"..tostring(k)..">"] = v end
end

I don't know, maybe it's not the best solution, but it works for me :)