Showing with 4 additions and 3 deletions.
  1. +2 −1 lib/director/browser.js
  2. +2 −2 lib/director/router.js
@@ -183,7 +183,8 @@ var Router = exports.Router = function (routes) {
Router.prototype.init = function (r) {
var self = this;
this.handler = function(onChangeEvent) {
var url = self.history === true ? self.getPath() : onChangeEvent.newURL.replace(/.*#/, '');
var newURL = onChangeEvent && onChangeEvent.newURL || window.location.hash;
var url = self.history === true ? self.getPath() : newURL.replace(/.*#/, '');
self.dispatch('on', url);
};

@@ -366,10 +366,10 @@ Router.prototype.invoke = function (fns, thisArg, callback) {
return _every(fn, apply);
}
else if (typeof fn === 'function') {
return fn.apply(thisArg, fns.captures || null);
return fn.apply(thisArg, fns.captures || []);
}
else if (typeof fn === 'string' && self.resource) {
self.resource[fn].apply(thisArg, fns.captures || null);
self.resource[fn].apply(thisArg, fns.captures || []);
}
});
}