Fix coroutine.wrap() error propogation.
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ function printrunning()
|
|||||||
print("running is not nil")
|
print("running is not nil")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function foo (a)
|
function foo (a)
|
||||||
print("foo", a)
|
print("foo", a)
|
||||||
return coroutine.yield(2*a)
|
return coroutine.yield(2*a)
|
||||||
|
|||||||
Reference in New Issue
Block a user