debug: notify if a property is being overwritten
This commit is contained in:
parent
4aa75a1164
commit
df367e0749
1 changed files with 3 additions and 0 deletions
|
@ -106,6 +106,9 @@ app.context = function(obj){
|
||||||
|
|
||||||
debug('context: %j', names);
|
debug('context: %j', names);
|
||||||
names.forEach(function(name){
|
names.forEach(function(name){
|
||||||
|
if (Object.getOwnPropertyDescriptor(ctx, name)) {
|
||||||
|
debug('context: overwriting %j', name);
|
||||||
|
}
|
||||||
var descriptor = Object.getOwnPropertyDescriptor(obj, name);
|
var descriptor = Object.getOwnPropertyDescriptor(obj, name);
|
||||||
Object.defineProperty(ctx, name, descriptor);
|
Object.defineProperty(ctx, name, descriptor);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue