test for correct this on m.withAttr callback

This commit is contained in:
pelonpelon 2015-08-01 15:01:38 -05:00
parent 72c039c4dc
commit 352d093d90

View file

@ -1380,6 +1380,13 @@ function testMithril(mock) {
handler({currentTarget: {test: "foo"}})
return value === "foo"
})
test(function() {
var value
var _this
var handler = m.withAttr("test", function(data) {value = data}, _this)
handler({currentTarget: {test: "foo"}})
return value === "foo" && handler.this === _this
})
//m.trust
test(function() {return m.trust("test").valueOf() === "test"})