[debugger] simulate getters

pull/22966/head
Fedor Indutny 2011-09-08 10:59:38 +07:00
parent 00343a9af0
commit 2c2397d333
1 changed files with 7 additions and 0 deletions

View File

@ -652,6 +652,7 @@ 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;
}
}
@ -724,6 +725,12 @@ Interface.prototype.requireConnection = function() {
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);