Skip to content

Commit

Permalink
ExtendMatch: removed unnecessary local call
Browse files Browse the repository at this point in the history
  • Loading branch information
miripiruni committed Feb 16, 2017
1 parent ad9b2b7 commit 6b91a4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion lib/bemxjst/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ BEMXJST.prototype.compile = function compile(code) {
var tree = new Tree({
refs: {
applyCtx: applyCtxWrap,
local: localWrap,
apply: apply
}
});
Expand Down
9 changes: 2 additions & 7 deletions lib/bemxjst/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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);
};
}

Expand All @@ -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);
};
};

Expand Down

0 comments on commit 6b91a4b

Please sign in to comment.