diff options
Diffstat (limited to 'lib/plugins')
-rw-r--r-- | lib/plugins/context.js | 2 | ||||
-rw-r--r-- | lib/plugins/plugin.js | 10 |
2 files changed, 3 insertions, 9 deletions
diff --git a/lib/plugins/context.js b/lib/plugins/context.js index a192b7b..17cefb6 100644 --- a/lib/plugins/context.js +++ b/lib/plugins/context.js @@ -19,7 +19,7 @@ function pluginCtx(plugin) { error.deprecateField(ctx, 'options', book.config.dump(), '"options" property is deprecated, use config.get(key) instead'); // Loop for template filters/blocks - error.deprecateField(ctx, 'book', ctx, '"book" property is deprecated, this directly instead'); + error.deprecateField(ctx, 'book', ctx, '"book" property is deprecated, use "this" directly instead'); return ctx; } diff --git a/lib/plugins/plugin.js b/lib/plugins/plugin.js index 0fbbab1..4901579 100644 --- a/lib/plugins/plugin.js +++ b/lib/plugins/plugin.js @@ -270,10 +270,7 @@ BookPlugin.prototype.getFilters = function() { return _.mapValues(this.content.filters || {}, function(fn, filter) { return function() { - var ctx = _.extend( - this, - pluginCtx(that) - ); + var ctx = _.extend(pluginCtx(that), this); return fn.apply(ctx, arguments); }; @@ -289,10 +286,7 @@ BookPlugin.prototype.getBlocks = function() { var fn = block.exec; block.exec = function() { - var ctx = _.extend( - this, - pluginCtx(that) - ); + var ctx = _.extend(pluginCtx(that), this); return fn.apply(ctx, arguments); }; |