From fae98c10ece0a0d9a0e76c5e912b50dc65cb18b2 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Tue, 27 Aug 2013 21:24:53 -0700 Subject: [PATCH] add context debug() --- lib/application.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/application.js b/lib/application.js index 232d9db..f260ece 100644 --- a/lib/application.js +++ b/lib/application.js @@ -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; };