bem / bem-xjst

bem-xjst (eXtensible JavaScript Templates): declarative template engine for the browser and server
https://bem.github.io/bem-xjst
Other
116 stars 48 forks source link

`elem('*')` #95

Closed veged closed 9 years ago

veged commented 9 years ago

We need analog block('*') matcher for elements: elem('*').

indutny commented 9 years ago

@veged this is going to slow things down a lot... I'll need to do two lookups instead of one to check the elem('*').

How necessary is this? Could it be worked around?

veged commented 9 years ago

It's needed for functionality that can be bind to all BEM-entities (i.e. analog of match(this.ctx._myCustomField) without block). Can't imagine any workarounds...

Why we need two lookups in case when this.elem === undefined (elem('*') doesn't need to be checked)? In case this.elem !== undefined vice versa — block('*') doesn't need to be checked.

indutny commented 9 years ago

Nevermind, figured out how to do it without extra lookups. PTAL at how it works in 4.1.0 ;)

veged commented 9 years ago

cool! ;-)

can you point me exactly what I need to review? https://github.com/bem/bem-xjst/commit/6cb6f3b22601aa29680267d85b71288d0fc076e3#diff-958f90d6d94bb3ea244d8d1787058c15R681 looks good from quick view

indutny commented 9 years ago

Yep that was it ;)

indutny commented 9 years ago

Thanks!