mirror of https://github.com/nodejs/node.git
[debugger] revert to using getter
parent
199f90b138
commit
d36d5c34df
|
@ -653,8 +653,10 @@ function Interface() {
|
||||||
|
|
||||||
for (var i in proto) {
|
for (var i in proto) {
|
||||||
if (proto.hasOwnProperty(i) && ignored.indexOf(i) === -1) {
|
if (proto.hasOwnProperty(i) && ignored.indexOf(i) === -1) {
|
||||||
this.repl.context[i] = proto[i].bind(this);
|
Object.defineProperty(this.repl.context, i, {
|
||||||
this.repl.context[i]._debugger = true;
|
get: proto[i].bind(this),
|
||||||
|
enumerable: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -728,11 +730,6 @@ Interface.prototype.controlEval = function(code, context, filename, callback) {
|
||||||
try {
|
try {
|
||||||
var result = vm.runInContext(code, context, filename);
|
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);
|
if (this.paused === 0) return callback(null, result);
|
||||||
this.waiting = function() {
|
this.waiting = function() {
|
||||||
callback(null, result);
|
callback(null, result);
|
||||||
|
|
Loading…
Reference in New Issue