make getter-setters json-serializable

This commit is contained in:
Leo Horie 2014-04-19 22:22:02 -04:00
parent 0aba8aa4bd
commit cb6994dd93
9 changed files with 49 additions and 14 deletions

View file

@ -417,15 +417,15 @@ function testMithril(mock) {
test(function() {
var prop = m.prop("test")
prop("foo")
return prop() == "foo"
return prop() === "foo"
})
test(function() {
var prop = m.prop("test")
return JSON.stringify(prop) == "\"test\""
return JSON.stringify(prop) === '"test"'
})
test(function() {
var obj = { prop: m.prop("test") }
return JSON.stringify(obj) == "{\"prop\":\"test\"}"
var obj = {prop: m.prop("test")}
return JSON.stringify(obj) === '{"prop":"test"}'
})
//m.request