async-future
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -189,3 +189,7 @@ /* Copyright (c) 2013 Billy Tetrud - Free to use for any purpose: MIT License*/ | ||
}).catch(function(e) { | ||
setNext(f, cb(e)) | ||
try { | ||
setNext(f, cb(e)) | ||
} catch(e) { | ||
f.throw(e) | ||
} | ||
}) | ||
@@ -192,0 +196,0 @@ } else { |
{"name":"async-future", | ||
"description": "A powerful and yet simple futures library for javascript in node.js and in-browser.", | ||
"keywords": ["future", "promise", "deferred", "async", "parallel", "thread", "concurrency"], | ||
"version":"1.0.0", | ||
"version":"1.0.1", | ||
"main": "asyncFuture.js", | ||
@@ -19,3 +19,3 @@ "author": "Billy Tetrud <bitetrudpublic@gmail.com> (https://github.com/fresheneesz/)", | ||
"devDependencies": { | ||
"deadunit":"5.0.1", | ||
"deadunit":"5.0.3", | ||
"build-modules":"1.0.8" | ||
@@ -22,0 +22,0 @@ }, |
@@ -184,14 +184,7 @@ `async-future` | ||
* Long stack traces (where possible) | ||
* Think about how to handle domains - right now `done` throws into whatever domain the beggining of the chain was called in, instead of the context `done` was called in | ||
* This might be ok since `done` is intended to be a safety net, and not generally used to catch and report errors | ||
* Standalone bundles (via ) [build-modules](https://github.com/fresheneesz/buildModules) | ||
* Browser testing | ||
* Chrome [ ] | ||
* Firefox [ ] | ||
* IE10 [ ] | ||
* IE9 [ ] | ||
* IE8 [ ] | ||
* Opera [ ] | ||
* Standalone bundle (via ) [build-modules](https://github.com/fresheneesz/buildModules) | ||
* timeout or cancelation (probably cancellation is more general) | ||
* Long stack traces (where possible) | ||
@@ -201,2 +194,3 @@ Changelog | ||
* 1.0.1 - fixing obscure bug in `catch` | ||
* 1.0.0 - making a simple change that hugely improves performance at the cost of making it a little more impportant when exactly you call `return` or `throw` (though that also has the upside of allowing more control) | ||
@@ -203,0 +197,0 @@ * 0.1.18 - fixing bug in `finally` where exceptions and results weren't being correctly passed through |
@@ -288,3 +288,3 @@ "use strict"; | ||
t.test("former bugs", function() { | ||
this.count(8) | ||
this.count(9) | ||
@@ -435,2 +435,16 @@ this.test("Return result of then", function(t) { | ||
}) | ||
this.test("second catch not catching errors in error handler", function(t) { | ||
this.count(1) | ||
Future(undefined).then(function() { | ||
var f = new Future | ||
f.throw("crap") | ||
return f | ||
}).catch(function(e) { | ||
throw e | ||
}).catch(function(e) { | ||
t.eq(e, 'crap') | ||
}) | ||
}) | ||
}) | ||
@@ -437,0 +451,0 @@ |
44820
925
232