cleanup trailing whitespace in .js files

master
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.type = 'html';
this.body = '<p>Something <em>exploded</em>, please contact Maru.</p>';
// since we handled this manually we'll
// want to delegate to the regular app
// level error handling as well so that

View File

@ -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;

View File

@ -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;
};

View File

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

View File

@ -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
});

View File

@ -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();