Comparing version 0.13.0 to 0.13.1
/* | ||
Yaku v0.13.0 | ||
Yaku v0.13.1 | ||
(c) 2015 Yad Smood. http://ysmood.org | ||
@@ -336,3 +336,4 @@ License MIT | ||
* attached to it (for example with .catch()) later than after an event loop turn. | ||
* @param {Yaku} p The handled promise. | ||
* @param {Any} reason The rejection reason. | ||
* @param {Yaku} p The promise that was rejected. | ||
*/ | ||
@@ -557,7 +558,7 @@ Yaku.rejectionHandled = $noop; | ||
p[$unhandled] = 1; | ||
emitEvent($unhandledRejection, p._value, p); | ||
emitEvent($unhandledRejection, p); | ||
} | ||
}); | ||
function emitEvent (name, arg1, arg2) { | ||
function emitEvent (name, p) { | ||
var browserEventName = "on" + name.toLowerCase() | ||
@@ -567,7 +568,8 @@ , browserHandler = root[browserEventName]; | ||
if (process && process.listeners(name).length) | ||
process.emit(name, arg1, arg2); | ||
name === $unhandledRejection ? | ||
process.emit(name, p._value, p) : process.emit(name, p); | ||
else if (browserHandler) | ||
browserHandler({ reason: arg1, promise: arg2 }); | ||
browserHandler({ reason: p._value, promise: p }); | ||
else | ||
Yaku[name](arg1, arg2); | ||
Yaku[name](p._value, p); | ||
} | ||
@@ -574,0 +576,0 @@ |
{ | ||
"name": "yaku", | ||
"version": "0.13.0", | ||
"version": "0.13.1", | ||
"description": "A light-weight ES6 Promises/A+ implementation that doesn't hurt.", | ||
@@ -5,0 +5,0 @@ "main": "lib/yaku.js", |
@@ -24,3 +24,3 @@ <a href="http://promisesaplus.com/"> | ||
- The minified file is only 3.3KB (1.5KB gzipped) | ||
- The minified file is only 3.4KB (2KB gzipped) | ||
- [Better "possibly unhandled rejection" and "long stack trace"][docs/debugHelperComparison.md] than [Bluebird][] | ||
@@ -84,3 +84,3 @@ - Much better performance than the native Promise | ||
| ---- | ---------- | -------------- | ---------------- | ------- | ------ | | ||
| [yaku][]@0.11.6 | ✓ | 330ms / 106MB | ✓ | 29 | 3.8KB | | ||
| [yaku][]@0.11.6 | ✓ | 330ms / 106MB | ✓ | 29 | 3.4KB | | ||
| [bluebird][]@3.3.1 | x (18 failing) | 265ms / 88MB | partial | 100 | 52.2KB | | ||
@@ -156,3 +156,3 @@ | [es6-promise][]@3.1.2 | x (52 failing) | 426ms / 113MB | x | 10 | 6.3KB | | ||
- [Yaku.unhandledRejection(reason, p)](#yakuunhandledrejectionreason-p) | ||
- [Yaku.rejectionHandled(p)](#yakurejectionhandledp) | ||
- [Yaku.rejectionHandled(reason, p)](#yakurejectionhandledreason-p) | ||
- [Yaku.enableLongStackTrace](#yakuenablelongstacktrace) | ||
@@ -420,3 +420,3 @@ - [Yaku.nextTick](#yakunexttick) | ||
- ### **[Yaku.rejectionHandled(p)](src/yaku.js?source#L333)** | ||
- ### **[Yaku.rejectionHandled(reason, p)](src/yaku.js?source#L334)** | ||
@@ -426,7 +426,11 @@ Emitted whenever a Promise was rejected and an error handler was | ||
- **<u>param</u>**: `reason` { _Any_ } | ||
The rejection reason. | ||
- **<u>param</u>**: `p` { _Yaku_ } | ||
The handled promise. | ||
The promise that was rejected. | ||
- ### **[Yaku.enableLongStackTrace](src/yaku.js?source#L347)** | ||
- ### **[Yaku.enableLongStackTrace](src/yaku.js?source#L348)** | ||
@@ -446,3 +450,3 @@ It is used to enable the long stack trace. | ||
- ### **[Yaku.nextTick](src/yaku.js?source#L370)** | ||
- ### **[Yaku.nextTick](src/yaku.js?source#L371)** | ||
@@ -449,0 +453,0 @@ Only Node has `process.nextTick` function. For browser there are |
84554
1536
1069