From d36d5c34dfe46888d2f039b065fd189581ef7cd3 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Thu, 8 Sep 2011 21:18:23 +0700 Subject: [PATCH] [debugger] revert to using getter --- lib/_debugger.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/_debugger.js b/lib/_debugger.js index b374df6..e87caf7 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -653,8 +653,10 @@ function Interface() { for (var i in proto) { if (proto.hasOwnProperty(i) && ignored.indexOf(i) === -1) { - this.repl.context[i] = proto[i].bind(this); - this.repl.context[i]._debugger = true; + Object.defineProperty(this.repl.context, i, { + get: proto[i].bind(this), + enumerable: true + }); } } @@ -728,11 +730,6 @@ Interface.prototype.controlEval = function(code, context, filename, callback) { try { var result = vm.runInContext(code, context, filename); - // Simulate getters - if (typeof result === 'function' && result._debugger) { - result = result(); - } - if (this.paused === 0) return callback(null, result); this.waiting = function() { callback(null, result); -- 2.7.4