Skip to content
Myr

Fixed hookImmutable()

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

authored by visionmedia · committed by visionmedia · parent 78ee497 · Browse files · 2 files+21 added−10 removed
This commit

State

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

Diff stats

2 files+21 added−10 removed

  • tests:+13 added−5 removed
  • other:+8 added−5 removed

2 files+21 added−10 removed

modified:lib/express.core.js+8 added-5 removed
63 unmodified lines
64 65 hook : function(name, args) {66 var results = []67 for (i = 0, len = this.modules.length; i < len; ++i)68 for (var key in this.modules[i][name])68 if (typeof this.modules[i][name] == 'function')69 results.push(this.modules[i][name].apply(this.modules[i], this.argsArray(arguments, 1)))69 if (this.modules[i][name].hasOwnProperty(key))70 results.push(this.modules[i][name][key].apply(this.modules[i], this.argsArray(arguments, 1)))71 return results72 },73 74 /**75 * Invoke hook _name_ with _immutable_ and _args_, returning76 * the _immutable_ variable once modified by each hook implementation.77 * When implementing these hooks, the function must return a value.78 *79 * @param {string} name80 * @param {mixed} immutable81 * @param {...} args82 * @return {mixed}83 * @api public84 */85 84 hookImmutable : function(immutable, args) {86 hookImmutable : function(name, immutable, args) {87 for (i = 0, len = this.modules.length; i < len; ++i)86 if (typeof this.modules[i][name] == 'function')87 immutable = this.modules[i][name].apply(this.modules[i], this.argsArray(arguments, 1))88 for (var key in this.modules[i][name])89 if (this.modules[i][name].hasOwnProperty(key))90 immutable = this.modules[i][name][key].call(this.modules[i], immutable)91 return immutable92 },93 94 /**
506 unmodified lines
modified:spec/spec.modules.js+13 added-5 removed