Skip to content
Myr

Removed several hasOwnProperty() calls

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 10ce37f · Browse files · 1 file+18 added−25 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+18 added−25 removed

  • other:+18 added−25 removed

1 file+18 added−25 removed

modified:lib/express.core.js+18 added-25 removed
112 unmodified lines
113 hook : function(name, args) {114 var results = []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))) 117 results.push(this.modules[i][name][key].apply(this.modules[i], this.argsArray(arguments, 1))) 118 return results119 },120 121 /**
10 unmodified lines
132 133 hookImmutable : function(name, immutable, args) {134 for (var i = 0, len = this.modules.length; i < len; ++i)135 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)136 immutable = this.modules[i][name][key].call(this.modules[i], immutable)137 return immutable138 },139 140 /**
12 unmodified lines
153154 if ('settings' in module) {155 if (!module.name) throw 'module name is required when using .settings'156 for (var name in module.settings)159 if (module.settings.hasOwnProperty(name))160 Express.settings[module.name][name] = module.settings[name]157 Express.settings[module.name][name] = module.settings[name]158 }159 160 if ('utilities' in module)161 for (var name in module.utilities)165 if (module.utilities.hasOwnProperty(name))166 Express.utilities[name] = module.utilities[name]162 Express.utilities[name] = module.utilities[name]163 164 Express.modules.push(module)165 },166
82 unmodified lines
249 250 hashToArray : function(hash) {251 var array = []252 for (var key in hash)257 if (hash.hasOwnProperty(key))258 array.push([key, hash[key]])253 array.push([key, hash[key]])254 return array255 },256 257 /**
61 unmodified lines
319 status : function(value) {320 if (value == undefined) return321 if (typeof value == 'number') return this.response.status = value322 for (var code in node.http.STATUS_CODES)328 if (node.http.STATUS_CODES.hasOwnProperty(code))329 if (node.http.STATUS_CODES[code].toLowerCase() == value.toLowerCase())330 return this.response.status = parseInt(code)323 if (node.http.STATUS_CODES[code].toLowerCase() == value.toLowerCase())324 return this.response.status = parseInt(code)325 },326327 /**328 * Return path segment _n_.
91 unmodified lines
420 */421 422 parseNestedParams : function(params) {423 for (var key in params)430 if (params.hasOwnProperty(key))431 if (parts = key.split('['))432 if (parts.length > 1)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]424 if (parts = key.split('['))425 if (parts.length > 1)426 for (var i = 0, prop = params, len = parts.length; i < len; ++i) {427 var name = parts[i].replace(']', '')428 if (i == len - 1) {429 prop[name] = params[key]430 prop = params, delete params[key]438 }439 else {440 prop = prop[name] = prop[name] || {}441 }431 }432 else {433 prop = prop[name] = prop[name] || {}434 }435 }436 437 return params438 },439
257 unmodified lines