add context debug()
This commit is contained in:
parent
ddc7347afe
commit
fae98c10ec
1 changed files with 5 additions and 1 deletions
|
@ -102,10 +102,14 @@ app.use = function(fn){
|
|||
|
||||
app.context = function(obj){
|
||||
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);
|
||||
Object.defineProperty(ctx, name, descriptor);
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue