Fix login / error handling

pull/117/merge
Nikolai Onken 2015-07-07 08:50:06 +00:00
rodzic 59ad896919
commit 37286ec012
1 zmienionych plików z 16 dodań i 10 usunięć

14
node_modules/frontdoor/lib/section.js wygenerowano vendored
Wyświetl plik

@ -96,16 +96,22 @@ module.exports = function Section(name, description, types) {
*/ */
this.mount = function(name, section) { this.mount = function(name, section) {
if ( arguments.length == 1 ){ var that = this;
if (arguments.length == 1) {
section = arguments[0]; section = arguments[0];
if ( ! ( section instanceof Section ) ) if (!(section instanceof Section))
throw new Error("Single argument to mount must be a Section!"); throw new Error("Single argument to mount must be a Section!");
var addRoutes = section.getRoutes(); var addRoutes = section.getRoutes();
Object.keys(addRoutes).forEach(function( method){ Object.keys(addRoutes).forEach(function(method) {
routes[method] = [].concat( routes[method], addRoutes[method] ); var r = addRoutes[method];
r.forEach(function(route) {
route.parent = that;
})
routes[method] = [].concat(routes[method], r);
}); });
return; return;