Skip to content

Instantly share code, notes, and snippets.

@DarkWiiPlayer
Last active October 20, 2018 15:38
Show Gist options
  • Save DarkWiiPlayer/2f9440e59b4ded14073d50c52f9569e6 to your computer and use it in GitHub Desktop.
Save DarkWiiPlayer/2f9440e59b4ded14073d50c52f9569e6 to your computer and use it in GitHub Desktop.
Weird moonscript bug
moonscript = require "moonscript"
moonscript.loadstring('print "\\nHere I am!"', 'string', 't', setmetatable({}, {
__index: (key) =>
print "index", key
for key, value in pairs debug.getinfo 2
print '', key, value
print debug.traceback()
}))()
index scope
currentline 706
nparams 2
name tree
lastlinedefined 731
isvararg false
short_src /usr/local/share/lua/5.3/moonscript/compile.lua
namewhat field
func function: 0xeb16e0
istailcall false
linedefined 701
source @/usr/local/share/lua/5.3/moonscript/compile.lua
nups 5
what Lua
stack traceback:
wtf.moon:8: in metamethod '__index'
/usr/local/share/lua/5.3/moonscript/compile.lua:706: in function 'moonscript.compile.tree'
/usr/local/share/lua/5.3/moonscript/base.lua:60: in function 'moonscript.to_lua'
/usr/local/share/lua/5.3/moonscript/base.lua:90: in function 'moonscript.loadstring'
wtf.moon:2: in upvalue 'moonscript_chunk'
...local/lib/luarocks/rocks-5.3/moonscript/0.5.0-1/bin/moon:86: in function <...local/lib/luarocks/rocks-5.3/moonscript/0.5.0-1/bin/moon:84>
[C]: in function 'xpcall'
...local/lib/luarocks/rocks-5.3/moonscript/0.5.0-1/bin/moon:99: in function <...local/lib/luarocks/rocks-5.3/moonscript/0.5.0-1/bin/moon:47>
(...tail calls...)
[C]: in ?
index implicitly_return_root
currentline 627
nparams 2
lastlinedefined 631
isvararg false
short_src /usr/local/share/lua/5.3/moonscript/compile.lua
namewhat
func function: 0xeb1240
istailcall true
linedefined 626
source @/usr/local/share/lua/5.3/moonscript/compile.lua
nups 1
what Lua
stack traceback:
wtf.moon:8: in metamethod '__index'
/usr/local/share/lua/5.3/moonscript/compile.lua:627: in function </usr/local/share/lua/5.3/moonscript/compile.lua:626>
(...tail calls...)
Here I am!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment