Localizing loop vars
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by visionmedia · committed by visionmedia · parent f87eb47 · Browse files · 1 file·+9 added−9 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+9 added−9 removed
- other:+9 added−9 removed
Provenance
- Commit
10ce37f- Tree
2c2f65b- Author
visionmedia <tj@vision-media.ca>- Committer
visionmedia <tj@vision-media.ca>- Parent
f87eb47
1 file changed+9 added−9 removed
modified:lib/express.core.js+9 added-9 removed
110 unmodified lines111 */112 113 hook : function(name, args) {114 var results = []115- for (i = 0, len = this.modules.length; i < len; ++i)115+ for (var i = 0, len = this.modules.length; i < len; ++i)116 for (var key in this.modules[i][name])117 if (this.modules[i][name].hasOwnProperty(key))118 results.push(this.modules[i][name][key].apply(this.modules[i], this.argsArray(arguments, 1))) 119 return results11 unmodified lines131 * @api public132 */133 134 hookImmutable : function(name, immutable, args) {135- for (i = 0, len = this.modules.length; i < len; ++i)135+ for (var i = 0, len = this.modules.length; i < len; ++i)136 for (var key in this.modules[i][name])137 if (this.modules[i][name].hasOwnProperty(key))138 immutable = this.modules[i][name][key].call(this.modules[i], immutable)139 return immutable129 unmodified lines269 */270 271 arrayToHash : function(array) {272 var hash = {}273- for (i = 0, len = array.length; i < len; ++i)273+ for (var i = 0, len = array.length; i < len; ++i)274 hash[array[i][0].toLowerCase()] = array[i][1]275 return hash276 },277 130 unmodified lines408 */409 410 parseParams : function(string) {411 var params = {}, pairs = string.split('&'), pair412- for (i = 0, len = pairs.length; i < len; ++i) {412+ for (var i = 0, len = pairs.length; i < len; ++i) {413 pair = pairs[i].split('=')414 params[pair[0]] = pair[1]415 }416 return this.parseNestedParams(params)12 unmodified lines429 for (var key in params)430 if (params.hasOwnProperty(key))431 if (parts = key.split('['))432 if (parts.length > 1)433- for (i = 0, prop = params, len = parts.length; i < len; ++i) {433+ for (var i = 0, prop = params, len = parts.length; i < len; ++i) {434 var name = parts[i].replace(']', '')435 if (i == len - 1) {436 prop[name] = params[key]437 prop = params, delete params[key]17 unmodified lines455 parseCookie : function(cookie) {456 var hash = {}457 if (!cookie) return hash458 var attrs = cookie.split(/\s*;\s*/)459- for (i = 0; i < attrs.length; ++i)459+ for (var i = 0; i < attrs.length; ++i)460 hash[attrs[i].split('=')[0]] = unescape(attrs[i].split('=')[1])461 return hash462 },463 122 unmodified lines586 routeProvides : function(route, request) {587 if (!route.options.provides) return true588 if (route.options.provides.constructor != Array) 589 route.options.provides = [route.options.provides]590- for (i = 0, len = route.options.provides.length; i < len; ++i)590+ for (var i = 0, len = route.options.provides.length; i < len; ++i)591 if (request.headers.accept && request.headers.accept.match(route.options.provides[i]))592 return true593 return false594 },10 unmodified lines605 606 callRouteFor : function(request) {607 var route = this.findRouteFor(request) || this.settings.defaultRoute608 if (route.keys)609- for (i = 0, len = route.keys.length; i < len; ++i) 609+ for (var i = 0, len = route.keys.length; i < len; ++i) 610 this.request.uri.params[route.keys[i]] = Express.captures[i+1] || null611 var body = this.eval(Express.contentsOf(route.callback))612 if (typeof body != 'string') 613 throw "route `" + route.method.toUpperCase() + ' ' + route.path + "' must return a string"8 unmodified lines622 * @api private623 */624 625 findRouteFor : function(request) {626- for (i = 0, len = this.routes.length; i < len; ++i)626+ for (var i = 0, len = this.routes.length; i < len; ++i)627 if (this.routeMatches(this.routes[i], request))628 return this.routes[i]629 },630 73 unmodified lines