arcticfox1919 / LuaDardo

A Lua virtual machine written in Dart
Apache License 2.0
174 stars 33 forks source link

Return statement don't return if no return value provided #34

Open tatlook opened 5 months ago

tatlook commented 5 months ago

Running

var ls = LuaState.newState(); ls.openLibs(); ls.doString(""" function test() do print("Hello") return nil end print("World") end

test()

function test2() do print("Hello") return end print("World") end

test2() """);

Output:

Hello Hello World

'World' should not be printed. return nil did correctly, but return didn't.