mirror of
https://github.com/jashkenas/backbone.git
synced 2026-01-15 01:47:55 -05:00
@@ -947,7 +947,7 @@
|
||||
_bindRoutes: function() {
|
||||
if (!this.routes) return;
|
||||
var route, routes = _.keys(this.routes);
|
||||
while (typeof (route = routes.pop()) !== 'undefined') {
|
||||
while ((route = routes.pop()) != null) {
|
||||
var name = this.routes[route];
|
||||
this.route(route, name, this[name]);
|
||||
}
|
||||
|
||||
@@ -481,4 +481,15 @@ $(document).ready(function() {
|
||||
});
|
||||
});
|
||||
|
||||
test("#1746 - Router allows empty route.", 1, function() {
|
||||
var Router = Backbone.Router.extend({
|
||||
routes: {'': 'empty'},
|
||||
empty: function(){},
|
||||
route: function(route){
|
||||
strictEqual(route, '');
|
||||
}
|
||||
});
|
||||
new Router;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user