diff --git a/lib/techs/deps.js.js b/lib/techs/deps.js.js index 6d62ce29..ae9a3bb3 100644 --- a/lib/techs/deps.js.js +++ b/lib/techs/deps.js.js @@ -141,7 +141,12 @@ var Deps = exports.Deps = INHERIT({ var depsItem = new DepsItem(item, ctx); - fn.call(_this, depsItem); // _this.add(rootItem, 'shouldDeps', depsItem); + if (Array.isArray(item.elem)) { + //add only elems and not block + forEachItem('elem', item.elem, depsItem); + } else { + fn.call(_this, depsItem); // _this.add(rootItem, 'shouldDeps', depsItem); + } _this.parse( item.mustDeps, diff --git a/test/deps.js b/test/deps.js index 6fdb7f06..8b61ec7b 100644 --- a/test/deps.js +++ b/test/deps.js @@ -100,6 +100,23 @@ describe('Deps', function() { { '': { '': [ { block: 'b1' }, { block: 'b2' } ] } } )); + it('block with elems', assertDepsParse( + [ { block: 'b1', elems: [ 'e1', 'e2' ] } ], + { '': { '': [ + {block: 'b1'}, + {block: 'b1', elem: 'e1'}, + {block: 'b1', elem: 'e2'}, + ] } } + )); + + it('block with elem array', assertDepsParse( + [ { block: 'b1', elem: ['e1', 'e2'] } ], + { '': {'': [ + {block: 'b1', elem: 'e1'}, + {block: 'b1', elem: 'e2'} + ] } } + )); + }); describe('new format with techs', function() {