bem / bem-xjst

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

bem-xjst@1.2.1: Strange reordering of array with apply() #86

Closed tadatuta closed 9 years ago

tadatuta commented 9 years ago

For BEMJSON { block: 'b1' } and template

block('b1').content()(function() {
    return [
        'first',
        apply('some-mode', {ctx: this.reapply({
            block: this.block,
            elem: 'elem1',
            content: 'second'
        })})
    ];
});

with bem-xjst@1.2.1 the result is

<div class="b1"><div class="b1__elem1">second</div>first</div>

but

<div class="b1">first<div class="b1__elem1">second</div></div>

expected.

And it works as expected with bem-xjst 4.0.1.

indutny commented 9 years ago

Was it working fine before in 1.x?

veged commented 9 years ago

@tadatuta what exactly you try to do? why both apply('some-mode' and this.reapply({appear? looks like strange template...

tadatuta commented 9 years ago

That's really strange template from Islands library. I opened this issue because tests failed and was hard to understand why. I do not insist on a fix.

veged commented 9 years ago

can you point me exactly code in islands? perhaps it should be rewritten

tadatuta commented 9 years ago

It's already rewritten there.

veged commented 9 years ago

ok then ;-)