From 6b91a4b1baef0befc747ed2f83fe2f720af22c47 Mon Sep 17 00:00:00 2001 From: miripiruni Date: Mon, 6 Feb 2017 20:01:01 +0300 Subject: [PATCH] ExtendMatch: removed unnecessary local call --- lib/bemxjst/index.js | 1 - lib/bemxjst/tree.js | 9 ++------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/bemxjst/index.js b/lib/bemxjst/index.js index 0015418a..debfe800 100644 --- a/lib/bemxjst/index.js +++ b/lib/bemxjst/index.js @@ -76,7 +76,6 @@ BEMXJST.prototype.compile = function compile(code) { var tree = new Tree({ refs: { applyCtx: applyCtxWrap, - local: localWrap, apply: apply } }); diff --git a/lib/bemxjst/tree.js b/lib/bemxjst/tree.js index bc191fca..1c08527d 100644 --- a/lib/bemxjst/tree.js +++ b/lib/bemxjst/tree.js @@ -100,7 +100,6 @@ exports.ExtendMatch = ExtendMatch; ExtendMatch.prototype.wrapBody = function wrapBody(body) { var refs = this.refs; var applyCtx = refs.applyCtx; - var local = refs.local; if (typeof body !== 'function') { return function inlineAdaptor() { @@ -110,9 +109,7 @@ ExtendMatch.prototype.wrapBody = function wrapBody(body) { for (var i = 0; i < keys.length; i++) changes[keys[i]] = body[keys[i]]; - return local(changes)(function preApplyCtx() { - return applyCtx(this.ctx); - }); + return applyCtx(this.ctx, changes); }; } @@ -124,9 +121,7 @@ ExtendMatch.prototype.wrapBody = function wrapBody(body) { for (var i = 0; i < keys.length; i++) changes[keys[i]] = obj[keys[i]]; - return local(changes)(function preApplyCtx() { - return applyCtx(this.ctx); - }); + return applyCtx(this.ctx, changes); }; };