Check that the 2nd argument to m.route is a string
This commit is contained in:
parent
e94a0a7c22
commit
c3d3fa7315
2 changed files with 33 additions and 1 deletions
|
|
@ -517,7 +517,7 @@ Mithril = m = new function app(window, undefined) {
|
|||
var redirect = function() {}, routeParams = {}, currentRoute
|
||||
m.route = function() {
|
||||
if (arguments.length === 0) return currentRoute
|
||||
else if (arguments.length === 3 && typeof arguments[1] == "string") {
|
||||
else if (arguments.length === 3 && isStr(arguments[1])) {
|
||||
var root = arguments[0], defaultRoute = arguments[1], router = arguments[2]
|
||||
redirect = function(source) {
|
||||
var path = currentRoute = normalizeRoute(source)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue