Fix maven example code to match API changes.

This commit is contained in:
James Roseborough
2014-01-02 08:17:08 +00:00
parent 25a5e98fe0
commit 48a214fc20
2 changed files with 2 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ public class App
Globals globals = JsePlatform.standardGlobals(); Globals globals = JsePlatform.standardGlobals();
// Use the convenience function on the globals to load a chunk. // 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. // Use any of the "call()" or "invoke()" functions directly on the chunk.
chunk.call(); chunk.call();

View File

@@ -42,7 +42,7 @@ public class AppTest
public void testDirectEvaluation() { public void testDirectEvaluation() {
String script = "return math.pow(..., 3)"; String script = "return math.pow(..., 3)";
Globals globals = JsePlatform.standardGlobals(); Globals globals = JsePlatform.standardGlobals();
LuaValue chunk = globals.loadString(script, "cube"); LuaValue chunk = globals.load(script, "cube");
int result = chunk.call(LuaValue.valueOf(5)).toint(); int result = chunk.call(LuaValue.valueOf(5)).toint();
assertEquals(125, result); assertEquals(125, result);
} }