Skip to content

Commit

Permalink
Fix router execution
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed May 29, 2015
1 parent 1eb69a3 commit 00ef6af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -1476,11 +1476,11 @@
// order of the routes here to support behavior where the most general
// routes can be defined at the bottom of the route map.
_bindRoutes: function() {
var router = this;
var routes = _.result(this, 'routes');
if (!routes) return;
for (var route in routes) {
this.route(route, routes[route]);
}
_.reduceRight(routes, function(_, callback, route) {
router.route(route, callback);
}, void 0);
},

// Convert a route string into a regular expression, suitable for matching
Expand Down
2 changes: 1 addition & 1 deletion test/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@
});

var router = new RouterExtended();
deepEqual({home: "root", index: "index.html", show: "show", search: "search"}, router.routes);
deepEqual({home: "root", index: "index.html", show: "show", search: "search"}, router.routes());
});

test("#2538 - hashChange to pushState only if both requested.", 0, function() {
Expand Down

0 comments on commit 00ef6af

Please sign in to comment.