Browse files

fixed a display bug when both arguments and locals of a frame contain…

… a variable of the same name
  • Loading branch information...
1 parent b7fd43e commit 145b0856decdcd3f696961be954dd3f5264fb3af @dannycoates dannycoates committed Jul 24, 2010
Showing with 15 additions and 2 deletions.
  1. +13 −2 front-end/node/InspectorBackendStub.js
  2. +2 −0 readme.md
View
15 front-end/node/InspectorBackendStub.js
@@ -327,8 +327,19 @@ WebInspector.InspectorBackendStub.prototype = {
var obj = x[0];
var props = obj.locals.map(_decode);
var argi = 0;
- props = props.concat(obj.arguments.map(_decode));
- WebInspector.Callback.processCallback(arguments[0], props);
+ var args = obj.arguments.map(_decode);
+ args.forEach(function(arg) {
+ if (!props.some(function(p) { return arg.name === p.name; })) {
+ props.push(arg);
+ }
+ });
+ try {
+ WebInspector.Callback.processCallback(arguments[0], props);
+ }
+ catch(e)
+ {
+ console.error(JSON.stringify(e));
+ }
}
else {
WebInspector.nodeDebugger.getScope(id.frameId, id.scopeId, arguments[0]);
View
2 readme.md
@@ -68,6 +68,8 @@ This project started as a Chrome extension. For more info see the [wiki](http://
This is alpha quality code, so use at your own risk:
+* be careful about viewing the contents of Buffer objects, each byte is displayed as an individual array element, for anything but tiny Buffers this will take too long to render
+* if the 'this' object in a call frame is the global object, expanding it yield nothing
* while not stopped at a breakpoint the console doesn't always behave as you might expect
* pause on exceptions doesn't play nice with the node event loop
* closing the inspector does not stop debugging, you must stop inspector.js manually

0 comments on commit 145b085

Please sign in to comment.