diff options
author | Johan Preynat <johan.preynat@gmail.com> | 2016-04-20 15:59:53 +0200 |
---|---|---|
committer | Johan Preynat <johan.preynat@gmail.com> | 2016-04-20 15:59:53 +0200 |
commit | 71b59b1950dbbb02e95b34dfdb26e8ad8c6e31a0 (patch) | |
tree | 982f1c027490667230bb01d0171e4e8fded08f2b /lib | |
parent | a3300ad9c63c12faf9049234dff0b515edb3a870 (diff) | |
download | gitbook-71b59b1950dbbb02e95b34dfdb26e8ad8c6e31a0.zip gitbook-71b59b1950dbbb02e95b34dfdb26e8ad8c6e31a0.tar.gz gitbook-71b59b1950dbbb02e95b34dfdb26e8ad8c6e31a0.tar.bz2 |
Correctly detect promises from block.process in TemplateEngine.applyBlock()
Diffstat (limited to 'lib')
-rw-r--r-- | lib/template/index.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/template/index.js b/lib/template/index.js index 3177ae0..ae11bc9 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); }; |