public final class DebugLib extends Object
All functions in this library are provided inside the debug table. All functions
that operate over a thread have an optional first argument which is the thread to operate
over. The default is always the current thread.
| Modifier and Type | Method and Description |
|---|---|
static org.classdump.luna.runtime.LuaFunction |
getmetatable()
Returns the function
debug.getmetatable. |
static org.classdump.luna.runtime.LuaFunction |
getupvalue()
Returns the function
debug.getupvalue. |
static org.classdump.luna.runtime.LuaFunction |
getuservalue()
Returns the function
debug.getuservalue. |
static void |
installInto(org.classdump.luna.StateContext context,
org.classdump.luna.Table env)
Installs the debug library to the global environment
env in the state
context context. |
static org.classdump.luna.runtime.LuaFunction |
setmetatable()
Returns the function
debug.setmetatable. |
static org.classdump.luna.runtime.LuaFunction |
setupvalue()
Returns the function
debug.setupvalue. |
static org.classdump.luna.runtime.LuaFunction |
setuservalue()
Returns the function
debug.setuservalue. |
static org.classdump.luna.runtime.LuaFunction |
upvalueid()
Returns the function
debug.upvalueid. |
static org.classdump.luna.runtime.LuaFunction |
upvaluejoin()
Returns the function
debug.upvaluejoin. |
public static org.classdump.luna.runtime.LuaFunction getmetatable()
debug.getmetatable.
The following is the corresponding entry from the Lua Reference Manual:
debug.getmetatable (value)Returns the metatable of the given
valueor nil if it does not have a metatable.
debug.getmetatable functiondebug.getmetatablepublic static org.classdump.luna.runtime.LuaFunction getupvalue()
debug.getupvalue.
The following is the corresponding entry from the Lua Reference Manual:
debug.getupvalue (f, up)This function returns the name and the value of the upvalue with index
upof the functionf. The function returns nil if there is no upvalue with the given index.Variable names starting with
'('(open parenthesis) represent variables with no known names (variables from chunks saved without debug information).
debug.getupvalue functiondebug.getupvaluepublic static org.classdump.luna.runtime.LuaFunction getuservalue()
debug.getuservalue.
The following is the corresponding entry from the Lua Reference Manual:
debug.getuservalue (u)Returns the Lua value associated to
u. Ifuis not a userdata, returns nil.
debug.getuservalue functiondebug.getuservaluepublic static org.classdump.luna.runtime.LuaFunction setmetatable()
debug.setmetatable.
The following is the corresponding entry from the Lua Reference Manual:
debug.setmetatable (value, table)Sets the metatable for the given
valueto the giventable(which can be nil). Returnsvalue.
debug.setmetatable functiondebug.setmetatablepublic static org.classdump.luna.runtime.LuaFunction setupvalue()
debug.setupvalue.
The following is the corresponding entry from the Lua Reference Manual:
debug.setupvalue (f, up, value)This function assigns the value
valueto the upvalue with indexupof the function f. The function returns nil if there is no upvalue with the given index. Otherwise, it returns the name of the upvalue.
debug.setupvalue functiondebug.setupvaluepublic static org.classdump.luna.runtime.LuaFunction setuservalue()
debug.setuservalue.
The following is the corresponding entry from the Lua Reference Manual:
debug.setuservalue (udata, value)Sets the given
valueas the Lua value associated to the givenudata. udata must be a full userdata.Returns
udata.
debug.setuservalue functiondebug.setuservaluepublic static org.classdump.luna.runtime.LuaFunction upvalueid()
debug.upvalueid.
The following is the corresponding entry from the Lua Reference Manual:
debug.upvalueid (f, n)Returns a unique identifier (as a light userdata) for the upvalue numbered
nfrom the given function.These unique identifiers allow a program to check whether different closures share upvalues. Lua closures that share an upvalue (that is, that access a same external local variable) will return identical ids for those upvalue indices.
debug.upvalueid functiondebug.upvalueidpublic static org.classdump.luna.runtime.LuaFunction upvaluejoin()
debug.upvaluejoin.
The following is the corresponding entry from the Lua Reference Manual:
debug.upvaluejoin (f1, n1, f2, n2)Make the
n1-th upvalue of the Lua closuref1refer to then2-th upvalue of the Lua closuref2.
debug.upvaluejoin functiondebug.upvaluejoinpublic static void installInto(org.classdump.luna.StateContext context,
org.classdump.luna.Table env)
env in the state
context context.
If env.package.loaded is a table, adds the library table
to it with the key "debug", using raw access.
context - the state context, must not be nullenv - the global environment, must not be nullNullPointerException - if context or env is nullCopyright © 2016–2017. All rights reserved.