gopher-lua icon indicating copy to clipboard operation
gopher-lua copied to clipboard

string.debug() raises error, breaks vstruct module auto-detect of absense of capability

Open drauschenbach opened this issue 8 years ago • 0 comments

  1. What version of GopherLua are you using? : 2243d714d6c94951d8ccca8c851836ff47d401c9
  2. What version of Go are you using? : 1.9.2
  3. What operating system and processor architecture are you using? : Mac
  4. What did you do? : Load and use LuaRocks vstruct module for type serialization
  5. What did you expect to see? : no errors, like Lua and LuaJIT
  6. What did you see instead? :
GopherLua does not support the string.dump
stack traceback:
	[G]: in function 'dump'

The vstruct module uses the logic if string.dump then string.dump() to detect whether this capability is present. This obviously works in other Lua environments.

In the GopherLua environment, the function is published and offered, but it raises an error that it's unsupported. For compatibility, it's worth noting that GopherLua's approach is different than other VMs.

drauschenbach avatar Dec 14 '17 17:12 drauschenbach