From 4aa75a1164669a0be7dd7128ecd9ff5c5aeda487 Mon Sep 17 00:00:00 2001 From: Jonathan Ong Date: Sat, 5 Oct 2013 12:27:15 -0700 Subject: [PATCH] cleanup trailing whitespace in .js files --- examples/errors.js | 2 +- examples/negotiation.js | 2 +- lib/application.js | 6 +++--- lib/context.js | 2 +- test/application.js | 6 +++--- test/context.js | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/errors.js b/examples/errors.js index c2d5227..4b50b22 100644 --- a/examples/errors.js +++ b/examples/errors.js @@ -15,7 +15,7 @@ app.use(function(next){ this.status = err.status || 500; this.type = 'html'; this.body = '

Something exploded, please contact Maru.

'; - + // since we handled this manually we'll // want to delegate to the regular app // level error handling as well so that diff --git a/examples/negotiation.js b/examples/negotiation.js index 9cb0865..57687da 100644 --- a/examples/negotiation.js +++ b/examples/negotiation.js @@ -36,7 +36,7 @@ app.use(function(next){ // no body? nothing to format, early return if (!this.body) return; - + // accepts json, koa handles this for us, // so just return if (this.accepts('json')) return; diff --git a/lib/application.js b/lib/application.js index dcabf72..34398a5 100644 --- a/lib/application.js +++ b/lib/application.js @@ -39,7 +39,7 @@ function Application() { this.poweredBy = true; this.jsonSpaces = 2; this.middleware = []; - this.Context = createContext(); + this.Context = createContext(); this.context(context); } @@ -103,13 +103,13 @@ app.use = function(fn){ app.context = function(obj){ var ctx = this.Context.prototype; var names = Object.getOwnPropertyNames(obj); - + debug('context: %j', names); names.forEach(function(name){ var descriptor = Object.getOwnPropertyDescriptor(obj, name); Object.defineProperty(ctx, name, descriptor); }); - + return this; }; diff --git a/lib/context.js b/lib/context.js index caf905f..12762e3 100644 --- a/lib/context.js +++ b/lib/context.js @@ -635,7 +635,7 @@ module.exports = { err.expose = true; throw err; }, - + /** * Default error handling. * diff --git a/test/application.js b/test/application.js index e4ebbf9..d2241fd 100644 --- a/test/application.js +++ b/test/application.js @@ -333,7 +333,7 @@ describe('app.respond', function(){ describe('app.context(obj)', function(){ it('should merge regular object properties', function(done){ var app = koa(); - + app.context({ a: 1, b: 2 @@ -357,7 +357,7 @@ describe('app.context(obj)', function(){ it('should merge accessor properties', function(done){ var app = koa(); - + app.context({ get something() { return this._something || 'hi'; @@ -391,7 +391,7 @@ describe('app.context(obj)', function(){ app.context({ a: 1 }); - + app.context({ b: 2 }); diff --git a/test/context.js b/test/context.js index 01a7fa1..60b121c 100644 --- a/test/context.js +++ b/test/context.js @@ -89,7 +89,7 @@ describe('ctx.error(msg)', function(){ var ctx = context(); try { - ctx.error('boom'); + ctx.error('boom'); } catch (err) { assert(500 == err.status); done();