Comparing version 0.17.7 to 0.17.8
var _ = require("./_"); | ||
_.Promise.prototype.guard = function (type, onRejected) { | ||
return this.catch(function (reason) { | ||
return this["catch"](function (reason) { | ||
if (reason instanceof type && onRejected) | ||
@@ -6,0 +6,0 @@ return onRejected(reason); |
@@ -31,3 +31,3 @@ var _ = require("./_"); | ||
function attempt (c) { | ||
return _.Promise.resolve(c).then(tryFn).catch(onError); | ||
return _.Promise.resolve(c).then(tryFn)["catch"](onError); | ||
} | ||
@@ -34,0 +34,0 @@ |
@@ -346,3 +346,3 @@ // This file contains all the non-ES6-standard helpers based on promise. | ||
* var timeout = require('yaku/lib/timeout'); | ||
* timeout(sleep(500), 100).catch((err) => { | ||
* timeout(sleep(500), 100)["catch"]((err) => { | ||
* console.error(err); | ||
@@ -349,0 +349,0 @@ * }); |
/* | ||
Yaku v0.17.7 | ||
Yaku v0.17.8 | ||
(c) 2015 Yad Smood. http://ysmood.org | ||
@@ -347,3 +347,3 @@ License MIT | ||
* // The below won't log the unhandled rejection error message. | ||
* Promise.reject('v').catch(() => {}); | ||
* Promise.reject('v')["catch"](() => {}); | ||
* ``` | ||
@@ -362,3 +362,3 @@ */ | ||
* Emitted whenever a Promise was rejected and an error handler was | ||
* attached to it (for example with `.catch()`) later than after an event loop turn. | ||
* attached to it (for example with `["catch"]()`) later than after an event loop turn. | ||
* @param {Any} reason The rejection reason. | ||
@@ -380,3 +380,3 @@ * @param {Yaku} p The promise that was rejected. | ||
* Promise.enableLongStackTrace(); | ||
* Promise.reject(new Error("err")).catch((err) => { | ||
* Promise.reject(new Error("err"))["catch"]((err) => { | ||
* console.log(err.longStack); | ||
@@ -383,0 +383,0 @@ * }); |
{ | ||
"name": "yaku", | ||
"version": "0.17.7", | ||
"version": "0.17.8", | ||
"description": "A lightweight promise library", | ||
@@ -5,0 +5,0 @@ "main": "lib/yaku.js", |
@@ -454,3 +454,3 @@ <a href="http://promisesaplus.com/"> | ||
// The below won't log the unhandled rejection error message. | ||
Promise.reject('v').catch(() => {}); | ||
Promise.reject('v')["catch"](() => {}); | ||
``` | ||
@@ -461,3 +461,3 @@ | ||
Emitted whenever a Promise was rejected and an error handler was | ||
attached to it (for example with `.catch()`) later than after an event loop turn. | ||
attached to it (for example with `["catch"]()`) later than after an event loop turn. | ||
@@ -486,3 +486,3 @@ - **<u>param</u>**: `reason` { _Any_ } | ||
Promise.enableLongStackTrace(); | ||
Promise.reject(new Error("err")).catch((err) => { | ||
Promise.reject(new Error("err"))["catch"]((err) => { | ||
console.log(err.longStack); | ||
@@ -965,3 +965,3 @@ }); | ||
var timeout = require('yaku/lib/timeout'); | ||
timeout(sleep(500), 100).catch((err) => { | ||
timeout(sleep(500), 100)["catch"]((err) => { | ||
console.error(err); | ||
@@ -968,0 +968,0 @@ }); |
142388