Skip to content

Commit

Permalink
some jshint cleanup
Browse files Browse the repository at this point in the history
some more errors but whatever
  • Loading branch information
jonathanong committed Mar 6, 2014
1 parent 3112f92 commit 5572897
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
7 changes: 2 additions & 5 deletions lib/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
*/

var EventEmitter = require('events').EventEmitter;

var merge = require('merge-descriptors')
, mixin = require('utils-merge')

var mixin = require('utils-merge');
var proto = require('./application')
, Route = require('./router/route')
, Router = require('./router')
, req = require('./request')
, res = require('./response')
, res = require('./response');

/**
* Expose `createApplication()`.
Expand Down
2 changes: 1 addition & 1 deletion lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ req.acceptsCharsets = function(){
*/

req.acceptsLanguage = // backwards compatibility
req.acceptsLanguages = function(lang){
req.acceptsLanguages = function(){
var accept = accepts(this);
return accept.languages.apply(accept, arguments);
};
Expand Down
1 change: 0 additions & 1 deletion lib/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var http = require('http')
, statusCodes = http.STATUS_CODES
, cookie = require('cookie')
, send = require('send')
, resolve = require('url').resolve
, basename = path.basename
, extname = path.extname
, mime = send.mime;
Expand Down
7 changes: 2 additions & 5 deletions lib/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var proto = module.exports = function(options) {

function router(req, res, next) {
router.handle(req, res, next);
};
}

// mixin Router class functions
router.__proto__ = proto;
Expand Down Expand Up @@ -199,8 +199,6 @@ proto.handle = function(req, res, done) {
trim_prefix();
});

return next(err);

function trim_prefix() {
var c = path[layer.path.length];
if (c && '/' != c && '.' != c) return next(err);
Expand Down Expand Up @@ -244,7 +242,6 @@ proto.handle = function(req, res, done) {
*/

proto.process_params = function(route, req, res, done) {
var self = this;
var params = this.params;

// captured parameters from the route, keys and values
Expand Down Expand Up @@ -288,7 +285,7 @@ proto.process_params = function(route, req, res, done) {
}

done();
};
}

// single param callbacks
function paramCallback(err) {
Expand Down
6 changes: 4 additions & 2 deletions lib/router/layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ Layer.prototype.match = function(path){
, params = this.params = {}
, m = this.regexp.exec(path)
, n = 0;
var key;
var val;

if (!m) return false;

for (var i = 1, len = m.length; i < len; ++i) {
var key = keys[i - 1];
key = keys[i - 1];

try {
var val = 'string' == typeof m[i]
val = 'string' == typeof m[i]
? decodeURIComponent(m[i])
: m[i];
} catch(e) {
Expand Down

0 comments on commit 5572897

Please sign in to comment.