cleanup trailing whitespace in .js files

This commit is contained in:
Jonathan Ong 2013-10-05 12:27:15 -07:00
parent 1e340e388f
commit 4aa75a1164
6 changed files with 10 additions and 10 deletions

View file

@ -15,7 +15,7 @@ app.use(function(next){
this.status = err.status || 500; this.status = err.status || 500;
this.type = 'html'; this.type = 'html';
this.body = '<p>Something <em>exploded</em>, please contact Maru.</p>'; this.body = '<p>Something <em>exploded</em>, please contact Maru.</p>';
// since we handled this manually we'll // since we handled this manually we'll
// want to delegate to the regular app // want to delegate to the regular app
// level error handling as well so that // level error handling as well so that

View file

@ -36,7 +36,7 @@ app.use(function(next){
// no body? nothing to format, early return // no body? nothing to format, early return
if (!this.body) return; if (!this.body) return;
// accepts json, koa handles this for us, // accepts json, koa handles this for us,
// so just return // so just return
if (this.accepts('json')) return; if (this.accepts('json')) return;

View file

@ -39,7 +39,7 @@ function Application() {
this.poweredBy = true; this.poweredBy = true;
this.jsonSpaces = 2; this.jsonSpaces = 2;
this.middleware = []; this.middleware = [];
this.Context = createContext(); this.Context = createContext();
this.context(context); this.context(context);
} }
@ -103,13 +103,13 @@ app.use = function(fn){
app.context = function(obj){ app.context = function(obj){
var ctx = this.Context.prototype; var ctx = this.Context.prototype;
var names = Object.getOwnPropertyNames(obj); var names = Object.getOwnPropertyNames(obj);
debug('context: %j', names); debug('context: %j', names);
names.forEach(function(name){ names.forEach(function(name){
var descriptor = Object.getOwnPropertyDescriptor(obj, name); var descriptor = Object.getOwnPropertyDescriptor(obj, name);
Object.defineProperty(ctx, name, descriptor); Object.defineProperty(ctx, name, descriptor);
}); });
return this; return this;
}; };

View file

@ -635,7 +635,7 @@ module.exports = {
err.expose = true; err.expose = true;
throw err; throw err;
}, },
/** /**
* Default error handling. * Default error handling.
* *

View file

@ -333,7 +333,7 @@ describe('app.respond', function(){
describe('app.context(obj)', function(){ describe('app.context(obj)', function(){
it('should merge regular object properties', function(done){ it('should merge regular object properties', function(done){
var app = koa(); var app = koa();
app.context({ app.context({
a: 1, a: 1,
b: 2 b: 2
@ -357,7 +357,7 @@ describe('app.context(obj)', function(){
it('should merge accessor properties', function(done){ it('should merge accessor properties', function(done){
var app = koa(); var app = koa();
app.context({ app.context({
get something() { get something() {
return this._something || 'hi'; return this._something || 'hi';
@ -391,7 +391,7 @@ describe('app.context(obj)', function(){
app.context({ app.context({
a: 1 a: 1
}); });
app.context({ app.context({
b: 2 b: 2
}); });

View file

@ -89,7 +89,7 @@ describe('ctx.error(msg)', function(){
var ctx = context(); var ctx = context();
try { try {
ctx.error('boom'); ctx.error('boom');
} catch (err) { } catch (err) {
assert(500 == err.status); assert(500 == err.status);
done(); done();