add context debug()

This commit is contained in:
TJ Holowaychuk 2013-08-27 21:24:53 -07:00
parent ddc7347afe
commit fae98c10ec

View file

@ -102,10 +102,14 @@ app.use = function(fn){
app.context = function(obj){ app.context = function(obj){
var ctx = this.Context.prototype; var ctx = this.Context.prototype;
Object.getOwnPropertyNames(obj).forEach(function(name){ var names = Object.getOwnPropertyNames(obj);
debug('context: %j', names);
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;
}; };