define("dojo/router/RouterBase", [ "dojo/_base/declare", "dojo/hash", "dojo/topic" ], function(declare, hash, topic){ // module: // dojo/router/RouterBase // Creating a basic trim to avoid needing the full dojo/string module // similarly to dojo/_base/lang's trim var trim; if(String.prototype.trim){ trim = function(str){ return str.trim(); }; }else{ trim = function(str){ return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); }; } // Firing of routes on the route object is always the same, // no clean way to expose this on the prototype since it's for the // internal router objects. function fireRoute(params, currentPath, newPath){ var queue, isStopped, isPrevented, eventObj, i, l; queue = this.callbackQueue; isStopped = false; isPrevented = false; eventObj = { stopImmediatePropagation: function(){ isStopped = true; }, preventDefault: function(){ isPrevented = true; }, oldPath: currentPath, newPath: newPath, params: params }; for(i=0, l=queue.length; i 0 ? parameterNames : null; }, _indexRoutes: function(){ var i, l, route, routeIndex, routes = this._routes; // Start a new route index routeIndex = this._routeIndex = {}; // Set it up again for(i=0, l=routes.length; i