diff --git a/lib/express.js b/lib/express.js index 485a8fc08d..594007b5b4 100644 --- a/lib/express.js +++ b/lib/express.js @@ -84,7 +84,7 @@ exports.urlencoded = bodyParser.urlencoded * Replace removed middleware with an appropriate error message. */ -;[ +var removedMiddlewares = [ 'bodyParser', 'compress', 'cookieSession', @@ -101,8 +101,10 @@ exports.urlencoded = bodyParser.urlencoded 'directory', 'limit', 'multipart', - 'staticCache', -].forEach(function (name) { + 'staticCache' +] + +removedMiddlewares.forEach(function (name) { Object.defineProperty(exports, name, { get: function () { throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.');