Skip to content
Myr

Converted more to use class.js

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

authored by visionmedia · committed by visionmedia · parent 6505f32 · Browse files · 7 files+11 added−26 removed
This commit

State

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

Diff stats

7 files+11 added−26 removed

  • tests:+3 added−3 removed
  • other:+8 added−23 removed

7 files+11 added−26 removed

modified:lib/express/plugins/session.js+2 added-2 removed
7 unmodified lines
8var utils = require('express/utils')910// --- Session1112var Session = Class({12var Session = new NewClass({13 14 /**15 * Initialize session _sid_.16 */17 18 init: function(sid) {18 constructor: function(sid) {19 this.id = sid20 this.touch()21 },22
179 unmodified lines
modified:lib/express/spec/mocks.js+3 added-3 removed
modified:lib/express/event.js+2 added-2 removed
modified:lib/express/http.js-1 removed
41 unmodified lines
42 else43 headers['content-length'] = data.length,44 headers['content-type'] = 'application/x-www-form-urlencoded'45 }46 46 var req = client.request(method, path + search + hash, headers)47 if (data && method !== 'GET') req.write(data)48 req.addListener('response', function(res){49 if (req.statusCode < 200 || req.statusCode >= 400)
44 unmodified lines
modified:lib/express/plugin.js+2 added-2 removed
30 unmodified lines
31}3233// --- Plugin3435exports.Plugin = Class({35exports.Plugin = new NewClass({36 37 /**38 * Initialize with _options_.39 *40 * @param {hash} options41 * @api private42 */43 44 init: function(options) {44 constructor: function(options) {45 if (options)46 utils.mixin(this, options)47 },48
13 unmodified lines
modified:lib/express/static.js+2 added-2 removed
8 unmodified lines
9 fs = require('fs')10 11// --- File1213exports.File = Class({13exports.File = new NewClass({14 15 /**16 * Initialize with file _path_.17 *18 * @param {string} path19 * @api public20 */21 22 init: function(path) {22 constructor: function(path) {23 this.path = path24 if (path.indexOf('..') != -1)25 Error.raise('InvalidPathError', "`" + path + "' is not a valid path")26 },
35 unmodified lines
modified:lib/express/utils.js-14 removed
73 unmodified lines
74 }, queryString.parseQuery(key))75 return orig76}7778/**79 * Return a clone of _obj_.80 *81 * @param {mixed} obj82 * @return {mixed}83 * @api public84 */8586function Clone() {}87exports.clone = function(obj) {88 Clone.prototype = obj89 return new Clone90}9178// From jQuery.extend in the jQuery JavaScript Library v1.3.279// Copyright (c) 2009 John Resig80// Dual licensed under the MIT and GPL licenses.81// http://docs.jquery.com/License
56 unmodified lines