bem/bem-xjst

Throw on apply undefined modes

qfox opened this issue · 1 comments

qfox commented

Input code or something about issue background

Since: 9d230c5
Because of: https://github.com/bem/bem-xjst/blob/master/lib/bemxjst/index.js#L519

https://goo.gl/2Nx5M1

[{
    block: 'test',
    cols: ['a', 'b']
}];
block('test')(
    content()(() => apply('cols')
        .map(c => ({ block: c }))))

Expected Behavior

Unknown mode exception

Actual Behavior

<div class="test">
    <div class="a"></div>
    <div class="b"></div>
</div>

Possible Solution

Throw somewhere here: https://github.com/bem/bem-xjst/blob/master/lib/bemxjst/index.js#L519

Your Environment

Current master

Fixed in #488