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

Add to docs reapply() behavior description in BEMTREE #189

Closed miripiruni closed 8 years ago

miripiruni commented 8 years ago
  it('should support this.reapply()', function() {
    test(function() {
      block('b1').content()(function() {
        this.wtf = 'fail';
        return this.reapply({ block: 'b2' });
      });

      block('b2').content()(function() {
        return this.wtf || 'ok';
      });
    }, { block: 'b1' }, {
      block: 'b1',
      content: {
        block: 'b2',
        content: 'ok'
      }
    });
  });

Actual result with v5.0.0: { block: 'b1', content: { block: 'b2', content: 'fail' } }

miripiruni commented 8 years ago

See #126

miripiruni commented 8 years ago

Done.