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

Ошибка при доступе к переменной из функции декларации #21

Closed hcodes closed 9 years ago

hcodes commented 9 years ago
block('b1').def()(function() {

function a() {
        return x;
}

var x = 1;

return a();
})

После компиляции:

function __$b1(__$ctx, __$ref) {
    function a__$0() {
        return x;
    }
    var x__$1 = 1;
    return a__$0();
}

Если в шаблоне var x поднять выше function a(), то все ок.

arikon commented 9 years ago

Will not be fixed in favor of bem-xjst@4.x.