Skip to content

Commit

Permalink
Revert "Handle error from generator"
Browse files Browse the repository at this point in the history
This reverts commit 1546728.
It doesn't work as expected.
  • Loading branch information
piroor committed Jun 4, 2015
1 parent 282aed2 commit 33f412a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions modules/utils.js
Expand Up @@ -1619,7 +1619,7 @@ doIteration : function(aGenerator, aCallbacks)
retVal.error = e;
retVal.value = true;
if (!aCallbacks)
throw e;
return retVal;

try {
if (aCallbacks.onEnd)
Expand All @@ -1638,7 +1638,7 @@ doIteration : function(aGenerator, aCallbacks)
retVal.error = e;
retVal.value = true;
if (!aCallbacks)
throw e;
return retVal;

try {
if (aCallbacks.onFail)
Expand All @@ -1662,7 +1662,7 @@ doIteration : function(aGenerator, aCallbacks)
retVal.error = e;
retVal.value = true;
if (!aCallbacks)
throw e;
return retVal;

try {
if (aCallbacks.onError)
Expand Down
6 changes: 3 additions & 3 deletions tests/uxu/unit/modules/utils_misc.test.js
Expand Up @@ -328,9 +328,9 @@ function test_doIterationWithError()
}

var iterator = TestGenerator();
assert.raises(Error, function() {
utilsModule.doIteration(iterator);
});
var retVal = utilsModule.doIteration(iterator);
yield 100;
assert.isInstanceOf(Error, retVal.error);
}

function test_doIterationCallbacks()
Expand Down

0 comments on commit 33f412a

Please sign in to comment.