lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


hi Mike,

I just changed my script to generate bytecode using string.dump. and I
found a incompatible with Lua's string.dump.

In Lua, the string.dump accept two argument: one is a function used to
dump and another is the name of generated chunk. this name is used in
debug information (such as assert(false, ...), and error()), but In
LuaJIT, the second parameter become a strip flags that indicated to
strip the debug information of chunk or not.

So, it means I can not given a chunk name using string.dump! If I give
a whatever second parameter, the debug information are all cleared
(that is, I can't get the e.g. line number with assert fault), but If
I don't give a second parameter, the whole code string become the name
of chunk -- that increase the size of generated byte code heavily and
makes no scenes at all!.

Maybe allow string.dump have three argument is better, one is
function, the second is the name of chunk, and the third is the strip
flags.

Thank you.