Fix coroutine.wrap() error propogation.

This commit is contained in:
James Roseborough
2007-10-23 00:49:52 +00:00
parent 932960c846
commit 504020beda
2 changed files with 5 additions and 2 deletions

View File

@@ -85,7 +85,10 @@ public class CoroutinesLib extends LFunction {
case 7: { // wrapped resume case 7: { // wrapped resume
LThread t = this.thread; LThread t = this.thread;
t.resumeFrom( vm, vm.gettop()-1 ); t.resumeFrom( vm, vm.gettop()-1 );
vm.remove(1); if ( vm.toboolean(1) )
vm.remove(1);
else
vm.error( vm.tostring(2), 0 );
return false; return false;
} }
} }