From 0108999fac17fe6ef92dc8cc142812bbaf5ce46d Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 5 Oct 2016 06:23:30 +0300 Subject: [PATCH] added .catch(..) to hidden promise, still thinking... Signed-off-by: Alex A. Naanou --- pwiki.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pwiki.js b/pwiki.js index 48a06f3..43e18ee 100755 --- a/pwiki.js +++ b/pwiki.js @@ -1097,6 +1097,14 @@ module.hiddenPromise = { } return this }, + // NOTE: this ignores the function if there is no promise... + // XXX not sure if this is correct... + catch: function(func){ + if(this.__promise != null){ + this.__promise.catch(func) + } + return this + }, // Like then, but the function will get called only if a .then(..) is // called right after...