Skip to content

Commit

Permalink
More squeeze
Browse files Browse the repository at this point in the history
  • Loading branch information
miripiruni committed Feb 16, 2017
1 parent 43a3cb7 commit fc5b329
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions lib/bemxjst/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,7 @@ BEMXJST.prototype.transformEntities = function(entities) {
continue;

var entity = entities[key];
if (entity.block !== block)
continue;

if (entity.elem === undefined)
if (entity.block !== block || entity.elem === undefined)
continue;

entities[key].prepend(wildcard);
Expand All @@ -265,11 +262,10 @@ BEMXJST.prototype.transformEntities = function(entities) {
};

BEMXJST.prototype._run = function(context) {
var res;
if (context === undefined || context === '' || context === null)
res = this.runEmpty();
return this.runEmpty();
else if (Array.isArray(context))
res = this.runMany(context);
return this.runMany(context);
else if (
typeof context.html === 'string' &&
!context.tag &&
Expand All @@ -278,12 +274,11 @@ BEMXJST.prototype._run = function(context) {
typeof context.cls === 'undefined' &&
typeof context.attrs === 'undefined'
)
res = this.runUnescaped(context);
return this.runUnescaped(context);
else if (utils.isSimple(context))
res = this.runSimple(context);
else
res = this.runOne(context);
return res;
return this.runSimple(context);

return this.runOne(context);
};

BEMXJST.prototype.run = function(json) {
Expand Down Expand Up @@ -377,10 +372,8 @@ BEMXJST.prototype.runOne = function(json) {
// To invalidate `applyNext` flags
this.depth++;

var key = this.classBuilder.build(block, elem);

var restoreFlush = false;
var ent = this.entities[key];
var ent = this.entities[this.classBuilder.build(block, elem)];
if (ent) {
if (this.canFlush && !ent.canFlush) {
// Entity does not support flushing, do not flush anything nested
Expand Down

0 comments on commit fc5b329

Please sign in to comment.