Added context for config handlers

This commit is contained in:
Sergey Kirillov 2014-05-31 13:38:55 +03:00
parent 16e6f6fdd5
commit 20b102b478
2 changed files with 18 additions and 1 deletions

View file

@ -45,3 +45,20 @@ test('issue99 regression', function() {
m.render(dummyEl, view2);
equal(dummyEl.innerHTML, '<div><span>0</span></div>', 'view2 should be rendered correctly');
});
test('config handler context', function() {
expect(3);
var view = m('div', {config: function(evt, isInitialized, context){
equal(context instanceof Object, true);
context.data = 1;
}})
m.render(dummyEl, view);
var view = m('div', {config: function(evt, isInitialized, context){
equal(context instanceof Object, true);
equal(context.data, 1);
}})
m.render(dummyEl, view);
})