Replace merge() calls with Object.merge()
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by visionmedia · committed by visionmedia · parent 606da1c · Browse files · 12 files·+21 added−21 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
12 files+21 added−21 removed
- tests:+1 added−1 removed
- other:+20 added−20 removed
Provenance
- Commit
5e32883- Tree
144b302- Author
visionmedia <tj@vision-media.ca>- Committer
visionmedia <tj@vision-media.ca>- Parent
606da1c
12 files changed+21 added−21 removed
modified:lib/express/plugins/cache.js+1 added-1 removed
210 unmodified lines211 * @api private212 */213 214 init: function(options) {215- this.merge(options || {})215+ Object.merge(this, options)216 this.store = new (this.dataStore || exports.Store.Memory)(options)217 Request.include({ cache: this.store })218 this.startReaper()219 },14 unmodified linesmodified:lib/express/plugins/hooks.js+1 added-1 removed
37 unmodified lines3839404142424344454627 unmodified lines37 unmodified lines * Initialize extensions. */ init: function() { global.merge({ Object.merge(global, { before: exports.before, after: exports.after }) }27 unmodified linesmodified:lib/express/plugins/logger.js+1 added-1 removed
65 unmodified lines6667686970707172737419 unmodified lines65 unmodified lines * @api private */
init: function(options) { this.merge(options || {}) Object.merge(this, options) } }, on: {19 unmodified linesmodified:lib/express/plugins/session.js+1 added-1 removed
179 unmodified lines180 */181 182 init: function(options) {183 this.cookie = {}184- this.merge(options || {})184+ Object.merge(this, options)185 this.cookie.httpOnly = true186 this.store = new (this.dataStore || exports.Store.Memory)(options)187 this.startReaper()188 },47 unmodified linesmodified:lib/express/plugins/view.js+1 added-1 removed
153 unmodified lines154 options.context = options.context || this155 content = (engines[engine] = engines[engine] || require(engine)).render(content, options)156 if (type === 'views') this.contentType(contentType)157 if (layout)158- this.render([layout, contentType, engine].join('.'), options.mergeDeep({158+ this.render([layout, contentType, engine].join('.'), Object.mergeDeep(options, {159 layout: false,160 locals: { body: content }161 }), callback)162 else if (type === 'partials')11 unmodified linesmodified:lib/express/spec/mocks.js+1 added-1 removed
77 unmodified lines78 'accept': 'application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5',79 'accept-language': 'en-us',80 'connection': 'keep-alive'81 }82- this.mergeDeep(options)82+ Object.mergeDeep(this, options)83 }84 })85 86 // --- MockResponse92 unmodified linesmodified:lib/express/core.js+2 added-2 removed
11 unmodified lines12 http = require('http'),13 sys = require('sys'),14 fs = require('fs')15 16-global.merge(require('express/plugin'))17-global.merge(require('express/dsl'))16+Object.merge(global, require('express/plugin'))17+Object.merge(global, require('express/dsl'))18 19 // --- Route20 21 Route = new Class({306 unmodified linesmodified:lib/express/event.js+1 added-1 removed
11 unmodified lines121314151616171819209 unmodified lines11 unmodified lines */ constructor: function(name, data) { this.name = name this.merge(data) Object.merge(this, data) }, /** * Return event string.9 unmodified linesmodified:lib/express/http.js+1 added-1 removed
27 unmodified lines28 path = url.pathname || '/',29 search = url.search || '',30 hash = url.hash || '',31 port = url.port || 80,32- headers = (headers || {}).merge({ Host: url.hostname }),32+ headers = Object.merge(headers || {}, { Host: url.hostname }),33 client = http.createClient(port, url.hostname)34 if (typeof data === 'object' && 'redirects' in data)35 redirects = data.redirects,36 delete data.redirects79 unmodified linesmodified:lib/express/plugins.js+9 added-9 removed
1 2 // Express - Plugins - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)3 4-global.merge(require('express/plugins/hooks'))5-global.merge(require('express/plugins/static'))6-global.merge(require('express/plugins/flash'))7-global.merge(require('express/plugins/cache'))8-global.merge(require('express/plugins/cookie'))9-global.merge(require('express/plugins/session'))10-global.merge(require('express/plugins/logger'))11-global.merge(require('express/plugins/content-length'))12-global.merge(require('express/plugins/method-override'))4+Object.merge(global, require('express/plugins/hooks'))5+Object.merge(global, require('express/plugins/static'))6+Object.merge(global, require('express/plugins/flash'))7+Object.merge(global, require('express/plugins/cache'))8+Object.merge(global, require('express/plugins/cookie'))9+Object.merge(global, require('express/plugins/session'))10+Object.merge(global, require('express/plugins/logger'))11+Object.merge(global, require('express/plugins/content-length'))12+Object.merge(global, require('express/plugins/method-override'))modified:lib/express/request.js+2 added-2 removed
46 unmodified lines47 * @api private48 */49 50 constructor: function(request, response) {51- this.merge(request)51+ Object.merge(this, request)52 response.headers = {}53 this.response = response 54 this.url = url.parse(this.url)55 this.url.pathname = exports.normalizePath(this.url.pathname) 252 unmodified lines308 if (data instanceof Function)309 reverse = callback,310 callback = data,311 data = null312- data = { request: this, response: this.response }.merge(data)312+ data = Object.merge({ request: this, response: this.response }, data)313 var self = this,314 complete = 0,315 total = this.plugins.length,316 plugins = reverse107 unmodified linesmodified:lib/support/extnot shown
Its text is not shown, modified.