Browse Source

debugger: Correctly eval arrays and numbers

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
0fa3f2febd
  1. 22
      lib/_debugger.js

22
lib/_debugger.js

@ -406,18 +406,32 @@ Client.prototype.mirrorObject = function(handle, cb) {
return;
}
var mirror = {};
var mirror;
if (handle.className == 'Array') {
mirror = [];
} else {
mirror = {};
}
for (var i = 0; i < handle.properties.length; i++) {
var value = res.body[handle.properties[i].ref];
mirror[handle.properties[i].name] = value.text;
var mirrorValue = value.value ? value.value : value.text;
if (Array.isArray(mirror) &&
typeof handle.properties[i].name != 'number') {
// Skip the 'length' property.
continue;
}
mirror[handle.properties[i].name] = mirrorValue;
}
if (cb) cb(mirror);
});
} else if (handle.type == 'string') {
} else if (handle.value) {
process.nextTick(function() {
cb(handle.text);
cb(handle.value);
});
} else {

Loading…
Cancel
Save