Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- behavior_table = {}
- behavior_table.doOne = function()
- print('lua do a function one')
- end
- behavior_table.customVar = 3
- behavior_table.doArray = function(array)
- print(behavior_table.customVar)
- print("Length:", array.length)
- print(array[0])
- Coerce = luajava.bindClass("org.luaj.vm2.lib.jse.CoerceLuaToJava")
- array[0] = 4
- print(array[0]) -- Throws a LuaError: index expected, got userdata
- print(Array.get(Coerce.coerce(array), 0)) -- Throws a NullPointerException
- end
- lua_behavior = luajava.createProxy("experiment.Bobject", behavior_table)
- return lua_behavior
Advertisement
Add Comment
Please, Sign In to add comment