Don't overwrite the options object when redirecting from onmatch with m.route.set, fix #1857

This commit is contained in:
Pierre-Yves Gérardy 2017-07-05 23:58:01 +02:00
parent 9b947f41f0
commit a867754d6a
2 changed files with 6 additions and 2 deletions

View file

@ -665,7 +665,7 @@ o.spec("route", function() {
route(root, "/a", {
"/a" : {
onmatch: function() {
route.set("/b")
route.set("/b", {}, {state: {a: 5}})
},
render: render
},
@ -684,6 +684,7 @@ o.spec("route", function() {
o(view.callCount).equals(1)
o(root.childNodes.length).equals(1)
o(root.firstChild.nodeName).equals("DIV")
o($window.history.state).deepEquals({a: 5})
done()
})