Merge pull request #739 from dgilland/origin/feature-propify-finally

Don't pass value/reason to promise.finally callback.
This commit is contained in:
Leo Horie 2015-08-04 15:03:47 -04:00
commit 7a5980631e
2 changed files with 6 additions and 6 deletions

View file

@ -3923,11 +3923,11 @@ function testMithril(mock) {
return prop().message === "error occurred" && error().message === "error occurred"
})
test(function() {
// Data returned by then() functions propagate to finally().
// Data returned by then() functions do *not* propagate to finally().
var data = m.prop("");
var prop = m.request({method: "GET", url: "test"}).then(function() {return "foo"})["finally"](data)
mock.XMLHttpRequest.$instances.pop().onreadystatechange()
return prop() === "foo" && data() === "foo"
return prop() === "foo" && data() === ""
})
test(function() {
// Data returned by finally() functions do *not* propagate to next promise.