public interface ChunkLoader
LuaFunction
.Modifier and Type | Method and Description |
---|---|
LuaFunction |
loadTextChunk(Variable env,
String chunkName,
String chunk)
Loads the text chunk
chunk (a string containing a Lua program) and returns
it as an instance of LuaFunction , supplying env as the chunk's sole
upvalue. |
LuaFunction loadTextChunk(Variable env, String chunkName, String chunk) throws LoaderException
chunk
(a string containing a Lua program) and returns
it as an instance of LuaFunction
, supplying env
as the chunk's sole
upvalue.
The argument chunkName
, typically the file name of the file containing
chunk
, is used to provide debugging information.
If chunk
is not a valid Lua program, a LoaderException
is thrown.
env
- the variable to be used as the sole upvalue of chunk
,
must not be null
chunkName
- chunk name, must not be null
chunk
- chunk text, must not be null
LoaderException
- if chunk
cannot be converted to a Lua function objectNullPointerException
- if env
, chunkName
or chunk
is null
Copyright © 2016. All rights reserved.