diff --git a/blocks-common/i-bem/__html/i-bem__html.bemhtml b/blocks-common/i-bem/__html/i-bem__html.bemhtml index 4c047246..2dfc33a3 100644 --- a/blocks-common/i-bem/__html/i-bem__html.bemhtml +++ b/blocks-common/i-bem/__html/i-bem__html.bemhtml @@ -389,7 +389,7 @@ default: { if (!mixItem) continue; - var hasItem = mixItem.block || mixItem.elem, + var hasItem = (mixItem.block && (this.block !== v.block || mixItem.block !== this.block)) || this.elem || mixItem.elem, block = mixItem.block || mixItem._block || this.block, elem = mixItem.elem || mixItem._elem || this.elem, mods = mixItem.mods || this.mods, diff --git a/blocks-common/i-bem/__html/test/files/i-bem/gh-core-804.bemhtml b/blocks-common/i-bem/__html/test/files/i-bem/gh-core-804.bemhtml new file mode 100644 index 00000000..113e0603 --- /dev/null +++ b/blocks-common/i-bem/__html/test/files/i-bem/gh-core-804.bemhtml @@ -0,0 +1 @@ +block b1, mix: { block: 'b2' } diff --git a/blocks-common/i-bem/__html/test/files/i-bem/gh-core-804.html b/blocks-common/i-bem/__html/test/files/i-bem/gh-core-804.html new file mode 100644 index 00000000..38ca10fb --- /dev/null +++ b/blocks-common/i-bem/__html/test/files/i-bem/gh-core-804.html @@ -0,0 +1 @@ +
diff --git a/blocks-common/i-bem/__html/test/files/i-bem/gh-core-804.json b/blocks-common/i-bem/__html/test/files/i-bem/gh-core-804.json new file mode 100644 index 00000000..6c8c6c3f --- /dev/null +++ b/blocks-common/i-bem/__html/test/files/i-bem/gh-core-804.json @@ -0,0 +1,18 @@ +[ +{ + "block": "b1", + "mix": { + "block": "b1", + "mods": { "m1": "v1" } + } +}, +{ + "block": "b1", + "elem": "e1", + "mix": [{ "block": "b1" }] +}, +{ + "block": "b1", + "mix": [{ "block": "b1", "elem": "e1" }] +} +] diff --git a/blocks-common/i-bem/__html/test/i-bem-test.js b/blocks-common/i-bem/__html/test/i-bem-test.js index ec3462a0..aab076f2 100644 --- a/blocks-common/i-bem/__html/test/i-bem-test.js +++ b/blocks-common/i-bem/__html/test/i-bem-test.js @@ -48,6 +48,7 @@ suite('i-bem block and others', function() { unit('applyNext in content regression #289', 'gh-289'); unit('mods redefinition #550', 'gh-550'); unit('block with escaping this', 'escaping-this'); + unit('mix with same block bem-core/804', 'gh-core-804'); test('re-entrance', function() { var t = bemhtml.compile(iBem + readFile('i-bem/re-entrant.bemhtml'));