Permalink
Browse files

Sync(): don't throw exception if no callback given

  • Loading branch information...
ybogdanov committed Feb 11, 2013
1 parent 3219b5c commit 5c5fa3eb0b40606266ed3e9844e50fff8a206a33
Showing with 8 additions and 6 deletions.
  1. +2 −1 lib/sync.js
  2. +6 −5 test/fiber.js
View
@@ -193,7 +193,8 @@ Sync.Fiber = function SyncFiber(fn, callback)
parent.callback(error);
}
else if (error) {
- throw error;
+ // TODO: what to do with such errors?
+ // throw error;
}
});
View
@@ -28,11 +28,12 @@ var runTest = module.exports = function(callback)
})
// Test throws exception without callback
- assert.throws(function(){
- Sync(function(){
- throw 'something went wrong';
- })
- }, 'something went wrong');
+ // Update: do not throw exception if no callback
+ // assert.throws(function(){
+ // Sync(function(){
+ // throw 'something went wrong';
+ // })
+ // }, 'something went wrong');
// Test callback throws exception
assert.throws(function(){

0 comments on commit 5c5fa3e

Please sign in to comment.