bem / bem-bl

Base BEM library
http://bem.github.com/bem-bl/
198 stars 84 forks source link

i-bem__dom: проверять, не уничтожен ли блок #637

Closed sameoldmadness closed 9 years ago

sameoldmadness commented 9 years ago

Due to syncronous modification change handlers execution _afterSetMod could be called after block destruction.

See https://github.com/bem/bem-bl/blob/support/2.x/blocks-common/i-bem/i-bem.js#L345,L351

Test case:

BEM.DOM.decl('kamikadze', {
    onSetMod: {
        js: {
            inited: function () {
                BEM.DOM.destruct(this.domElem);
            }
        }
    }
});

BEM.DOM.append('body', bh.apply({ block: 'kamikadze', js: true }));
sameoldmadness commented 9 years ago

bump

deeonis commented 9 years ago

we'll try to fix it next week: BEM-2297

alexbaumgertner commented 9 years ago

Should we port this code to bem-core?

tenorok commented 9 years ago

@sameoldmadness thank you for PR! For your convenience we just fix the codestyle in other branch. https://github.com/bem/bem-bl/pull/648

sameoldmadness commented 9 years ago

Line 964 is not consistent with line 767.

If curly braces are required, it should be enforced by jscs rule.

tenorok commented 9 years ago

I fully agree that it should be so, but now we have not jscs config for this project.