Comparing version 0.13.2 to 0.13.3
/* | ||
Yaku v0.13.2 | ||
Yaku v0.13.3 | ||
(c) 2015 Yad Smood. http://ysmood.org | ||
@@ -380,8 +380,2 @@ License MIT | ||
function isPlainArray (obj) { | ||
return obj | ||
&& typeof obj.length === "number" | ||
&& !isFunction(obj[Yaku[$Symbol][$iterator]]); | ||
} | ||
/** | ||
@@ -467,3 +461,10 @@ * Wrap a function into a try-catch. | ||
if (isPlainArray(iterable)) { | ||
if (!iterable) throw genTypeError($invalidArgument); | ||
var gen = iterable[Yaku[$Symbol][$iterator]]; | ||
if (isFunction(gen)) | ||
iter = gen.call(iterable); | ||
else if (isFunction(iterable.next)) | ||
iter = iterable; | ||
else if (iterable instanceof Array) { | ||
len = iterable.length; | ||
@@ -473,17 +474,11 @@ while (i < len) { | ||
} | ||
} else if (iterable) { | ||
var gen = iterable[Yaku[$Symbol][$iterator]]; | ||
if (isFunction(gen)) | ||
iter = gen.call(iterable); | ||
else if (isFunction(iterable.next)) | ||
iter = iterable; | ||
else | ||
throw genTypeError($invalidArgument); | ||
return i; | ||
} else | ||
throw genTypeError($invalidArgument); | ||
while (!(item = iter.next()).done) { | ||
ret = genTryCatcher(fn)(item.value, i++); | ||
if (ret === $tryErr) { | ||
if (isFunction(iter[$return])) iter[$return](); | ||
throw ret.e; | ||
} | ||
while (!(item = iter.next()).done) { | ||
ret = genTryCatcher(fn)(item.value, i++); | ||
if (ret === $tryErr) { | ||
if (isFunction(iter[$return])) iter[$return](); | ||
throw ret.e; | ||
} | ||
@@ -490,0 +485,0 @@ } |
{ | ||
"name": "yaku", | ||
"version": "0.13.2", | ||
"version": "0.13.3", | ||
"description": "A light-weight ES6 Promises/A+ implementation that doesn't hurt.", | ||
@@ -42,7 +42,7 @@ "main": "lib/yaku.js", | ||
"bluebird": "3.3.1", | ||
"core-js": "2.1.0", | ||
"core-js": "2.1.1", | ||
"es6-promise": "3.1.2", | ||
"es6-shim": "0.34.4", | ||
"eslint": "2.0.0", | ||
"junit": "1.1.3", | ||
"eslint": "2.2.0", | ||
"junit": "1.2.0", | ||
"mocha": "2.4.5", | ||
@@ -54,4 +54,4 @@ "nokit": "0.17.2", | ||
"setprototypeof": "1.0.1", | ||
"uglify-js": "2.6.1", | ||
"webpack": "1.12.13" | ||
"uglify-js": "2.6.2", | ||
"webpack": "1.12.14" | ||
}, | ||
@@ -58,0 +58,0 @@ "eslintConfig": { |
@@ -24,3 +24,3 @@ <a href="http://promisesaplus.com/"> | ||
- The minified file is only 3.3KB (2KB gzipped) | ||
- The minified file is only 3.2KB (2KB gzipped) | ||
- [Better "possibly unhandled rejection" and "long stack trace"][docs/debugHelperComparison.md] than [Bluebird][] | ||
@@ -79,3 +79,3 @@ - Much better performance than the native Promise | ||
Arch x64 | ||
CPU Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz | ||
CPU Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz | ||
``` | ||
@@ -85,10 +85,11 @@ | ||
| ---- | ---------- | -------------- | ---------------- | ------- | ------ | | ||
| [yaku][]@0.11.6 | ✓ | 330ms / 106MB | ✓ | 29 | 3.3KB | | ||
| [bluebird][]@3.3.1 | x (18 failing) | 265ms / 88MB | partial | 100 | 52.2KB | | ||
| [es6-promise][]@3.1.2 | x (52 failing) | 426ms / 113MB | x | 10 | 6.3KB | | ||
| [native][]@0.12.4 | x ( 4 failing) | 590ms / 173MB | x | 13 | 0KB | | ||
| [core-js][]@2.1.0 | x ( 4 failing) | 838ms / 198MB | x | 11 | 13.9KB | | ||
| [es6-shim][]@0.34.4 | ✓ | 950ms / 145MB | x | 12 | 130.8KB | | ||
| [q][]@1.4.1 | x (47 failing) | 1599ms / 425MB | x | 74 | 15.4KB | | ||
| [yaku][]@0.13.1 | ✓ | 337ms / 106MB | ✓ | 31 | 3.2KB | | ||
| [bluebird][]@3.3.1 | x (26 failing) | 258ms / 88MB | partial | 100 | 52.2KB | | ||
| [es6-promise][]@3.1.2 | x (39 failing) | 457ms / 112MB | x | 10 | 6.3KB | | ||
| [native][]@0.13.2 | x (7 failing) | 653ms / 168MB | x | 13 | 0KB | | ||
| [core-js][]@2.1.1 | x (2 failing) | 1014ms / 197MB | x | 11 | 18.7KB | | ||
| [es6-shim][]@0.34.4 | ✓ | 927ms / 145MB | x | 12 | 130.8KB | | ||
| [q][]@1.4.1 | x (68 failing) | 1609ms / 426MB | x | 74 | 15.4KB | | ||
- **Helpers**: extra methods that help with your promise programming, such as | ||
@@ -95,0 +96,0 @@ async flow control helpers, debug helpers. For more details: [docs/debugHelperComparison.md][]. |
1070
84259
1526