From 71b59b1950dbbb02e95b34dfdb26e8ad8c6e31a0 Mon Sep 17 00:00:00 2001 From: Johan Preynat Date: Wed, 20 Apr 2016 15:59:53 +0200 Subject: [PATCH] Correctly detect promises from block.process in TemplateEngine.applyBlock() --- lib/template/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/template/index.js b/lib/template/index.js index 3177ae030..ae11bc9bc 100644 --- a/lib/template/index.js +++ b/lib/template/index.js @@ -391,7 +391,7 @@ TemplateEngine.prototype.applyBlock = function(name, blk, ctx) { func = this.bindContext(block.process); r = func.call(ctx || {}, blk); - if (Promise.isPromise(r)) return r.then(normBlockResult); + if (Promise.isPromiseAlike(r)) return Promise(r).then(normBlockResult); else return normBlockResult(r); };