Skip to content

Commit

Permalink
When promisifying, store does not preserve disableNunjucks property
Browse files Browse the repository at this point in the history
This was causing difficulties in a less-maintained renderer I was using, but I think this may also count as a bug upstream.
  • Loading branch information
tcr authored Jul 27, 2017
1 parent e2b81fa commit 4966094
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/extend/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,18 @@ Renderer.prototype.register = function(name, output, fn, sync) {
name = getExtname(name);
output = getExtname(output);

var disableNunjucks = fn.disableNunjucks;
if (sync) {
this.storeSync[name] = fn;
this.storeSync[name].output = output;

this.store[name] = Promise.method(fn);
this.store[name].disableNunjucks = disableNunjucks;
} else {
if (fn.length > 2) fn = Promise.promisify(fn);
if (fn.length > 2) {
fn = Promise.promisify(fn);
fn.disableNunjucks = disableNunjucks;
}
this.store[name] = fn;
}

Expand Down

0 comments on commit 4966094

Please sign in to comment.