Fix bytecode generation for return values that are upvalues.

This commit is contained in:
James Roseborough
2010-07-30 05:02:29 +00:00
parent 860ca581ab
commit 67a0cac3f4
5 changed files with 91 additions and 56 deletions

View File

@@ -387,5 +387,16 @@ public class FragmentsTest extends TestSuite {
" return a()\n"+
"end\n");
}
public void testReturnUpvalue() {
runFragment( LuaValue.varargsOf(new LuaValue[] { LuaValue.ONE, LuaValue.valueOf(5), }),
"local a = 1\n"+
"local b\n"+
"function c()\n"+
" b=5\n" +
" return a\n"+
"end\n"+
"return c(),b\n" );
}
}
}