Correctly detect promises from block.process in TemplateEngine.applyBlock()

This commit is contained in:
Johan Preynat
2016-04-20 15:59:53 +02:00
parent a3300ad9c6
commit 71b59b1950
+1 -1
View File
@@ -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);
};