Fix maven example code to match API changes.
This commit is contained in:
@@ -17,7 +17,7 @@ public class App
|
||||
Globals globals = JsePlatform.standardGlobals();
|
||||
|
||||
// Use the convenience function on the globals to load a chunk.
|
||||
LuaValue chunk = globals.loadString(script, "maven-exmaple");
|
||||
LuaValue chunk = globals.load(script, "maven-exmaple");
|
||||
|
||||
// Use any of the "call()" or "invoke()" functions directly on the chunk.
|
||||
chunk.call();
|
||||
|
||||
@@ -42,7 +42,7 @@ public class AppTest
|
||||
public void testDirectEvaluation() {
|
||||
String script = "return math.pow(..., 3)";
|
||||
Globals globals = JsePlatform.standardGlobals();
|
||||
LuaValue chunk = globals.loadString(script, "cube");
|
||||
LuaValue chunk = globals.load(script, "cube");
|
||||
int result = chunk.call(LuaValue.valueOf(5)).toint();
|
||||
assertEquals(125, result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user