bem-archive / bemhtml-compat

Compatibility layer for old BEMHTML syntax
2 stars 1 forks source link

SyntaxError: Unexpected token if #4

Closed narqo closed 11 years ago

narqo commented 11 years ago

В скомпиллированном шаблоне, в секции функции applyc «появляется» вот такое (код отформатирован, в оригинале все в одну строку):

// ...
function applyc(__$ctx) {
            var __$mr = __$m1[__$ctx._mode];
            if(__$mr) {
                __$mr = __$mr(__$ctx)                    // ← вот тут не хватает ";"
                if(__$mr !== __$ref)return __$mr
            }

Это приводит к ошибке: "SyntaxError: Unexpected token if"

Стектрейс:

(__$ctx){var __$mr=__$m1[__$ctx._mode];if(__$mr){__$mr=__$mr(__$ctx)if(__$mr!=
                                                                    ^^
SyntaxError: Unexpected token if
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at [eval]:1:1
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:456:26)
    at evalScript (node.js:532:25)
indutny commented 11 years ago

Fixed in xjst@0.7.12