Closed
Bug 685403
Opened 14 years ago
Closed 13 years ago
finally block executed more than 1 time when using continuation
Categories
(Rhino Graveyard :: Core, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: gura, Unassigned)
Details
Attachments
(1 file)
1.23 KB,
text/plain
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50
Steps to reproduce:
this is my example code.
function openFile()
{
java.lang.System.out.println("openFile");
return new Object();
}
function doSomethingWithFile(file)
{
java.lang.System.out.println("doSomethingWithFile");
}
function sendEventToOther()
{
java.lang.System.out.println("sendEventToOther");
}
function doSomethingWithEvent(file , event)
{
java.lang.System.out.println("doSomethingWithEvent event = " + event);
}
function closeFile(file)
{
java.lang.System.out.println("closeFile");
}
try
{
file = openFile();
doSomethingWithFile(file);
sendEventToOther();
event = waitSomeEvent();
doSomethingWithEvent(file, event);
}
finally
{
closeFile(file);
}
waitSomeEvent() function throws ContinuationPending Exception, if there is no event in event queue.
Actual results:
this is output of above example script code.
openFile
doSomethingWithFile
sendEventToOther
closeFile
doSomethingWithEvent event = hello world
closeFile
In this case, the finally block (closeFile()) is executed twice when after ContinuationPending Exception thrown and after cx.resumeContinuation() called.
Expected results:
finally block should be executed only once.
Comment 1•13 years ago
|
||
Pull request at https://github.com/mozilla/rhino/pull/65
Comment 2•13 years ago
|
||
Thanks André, pull request merged.
https://github.com/mozilla/rhino/commit/a215da60caddf44ad8a97fd6acb4abcc18b00b15
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•