Skip to content

Commit

Permalink
Merge pull request #563 from /issues/550
Browse files Browse the repository at this point in the history
Use the same object for this.mods and this.ctx.mods within default mode
  • Loading branch information
tadatuta committed Oct 16, 2014
2 parents 071a63d + 2eb853c commit 90829e1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion blocks-common/i-bem/__html/i-bem__html.bemhtml
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ this._mode === '' {
this.block = vBlock || (vElem ? block : undefined),
this._currBlock = vBlock || vElem ? undefined : block,
this.elem = this.ctx.elem,
this.mods = (vBlock ? this.ctx.mods : this.mods) || {},
this.mods = vBlock? this.ctx.mods || (this.ctx.mods = {}) : this.mods,
this.elemMods = this.ctx.elemMods || {}
) {
(this.block || this.elem) ?
Expand Down
6 changes: 6 additions & 0 deletions blocks-common/i-bem/__html/test/files/i-bem/gh-550.bemhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
block b1, default: {
this.mods.foo = 'bar';
applyNext();
}

block b1, mod foo bar, content: 'foo bar';
1 change: 1 addition & 0 deletions blocks-common/i-bem/__html/test/files/i-bem/gh-550.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="b1 b1_foo_bar">foo bar</div>
3 changes: 3 additions & 0 deletions blocks-common/i-bem/__html/test/files/i-bem/gh-550.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"block": "b1"
}
1 change: 1 addition & 0 deletions blocks-common/i-bem/__html/test/i-bem-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ suite('i-bem block and others', function() {
unit('condition regression #239', 'gh-239', true);
unit('simple types regression #254', 'gh-254');
unit('applyNext in content regression #289', 'gh-289');
unit('mods redefinition #550', 'gh-550');
});

0 comments on commit 90829e1

Please sign in to comment.