Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[debugger] more testing

  • Loading branch information...
commit 0385b122bec1a663fcef9f55cd20dd0fcab1bf3c 1 parent d33e7b7
@indutny authored
Showing with 19 additions and 10 deletions.
  1. +18 −10 lib/_debugger.js
  2. +1 −0  lib/repl.js
View
28 lib/_debugger.js
@@ -644,20 +644,28 @@ function Interface() {
this.controlEval.bind(this));
// Lift all instance methods to repl context
- var proto = Interface.prototype,
+ var context = this.repl.context,
+ proto = Interface.prototype,
ignored = ['pause', 'resume', 'exitRepl', 'handleBreak',
'requireConnection', 'killChild', 'trySpawn',
'controlEval', 'debugEval'];
- for (var i in proto) {
- if (proto.hasOwnProperty(i) && ignored.indexOf(i) === -1) {
- Object.defineProperty(this.repl.context, i, {
- get: proto[i].bind(this),
- enumerable: true
- });
- //this.repl.context[i]._debugger = true;
- }
- }
+ Object.keys(proto).filter(function(key) {
+ return ignored.indexOf(key) === -1;
+ }).forEach(function(key) {
+ Object.defineProperty(context, key, {
+ get: function() {
+ try {
+ throw new Error();
+ } catch (e) {
+ console.log(key, e.stack.toString());
+ }
+ return;
+ proto[key].call(proto);
+ },
+ enumerable: true
+ });
+ });
this.waiting = null;
this.paused = 0;
View
1  lib/repl.js
@@ -419,6 +419,7 @@ REPLServer.prototype.complete = function(line, callback) {
if (!expr) {
if (this.context.constructor.name === 'Context') {
completionGroups.push(Object.getOwnPropertyNames(this.context));
+ console.log('here');
next();
} else {
this.eval('.scope', this.context, 'repl', function(err, globals) {
Please sign in to comment.
Something went wrong with that request. Please try again.