Permalink
Browse files

improved object parsing for certain types in scoped variables and con…

…sole
  • Loading branch information...
1 parent 1fb8d3d commit 710b3c274a3a7efa6d8604a5a9b70fed64226f6e @dannycoates dannycoates committed Aug 3, 2010
Showing with 28 additions and 4 deletions.
  1. +27 −3 front-end/node/InspectorFrontendHostStub.js
  2. +1 −1 readme.md
@@ -75,6 +75,9 @@ WebInspector.InspectorFrontendHostStub = function()
case 'null':
p.value = {description: 'null'};
break;
+ case 'script':
+ p.value = {description: value.text};
+ break;
default:
p.value = {description: value.value};
break;
@@ -83,14 +86,35 @@ WebInspector.InspectorFrontendHostStub = function()
};
function _property(prop) {
- var p = _valueOf(prop.value);
- p.name = String(prop.name);
+ var p = {};
+ if (prop.value != null) {
+ p = _valueOf(prop.value);
+ p.name = String(prop.name);
+ }
+ else if (prop.ref != null) {
+ p.value = {
+ description: '',
+ hasChildren: true,
+ injectedScriptId: prop.ref,
+ type: 'object'
+ };
+ p.name = String(prop.name);
+ }
+ else {
+ p = _valueOf(prop);
+ p.name = String(prop.name);
+ }
return p;
};
function refToProperties(ref) {
if (ref) {
- return ref.properties.map(_property);
+ if (ref.properties) {
+ return ref.properties.map(_property);
+ }
+ else {
+ return [_property(ref)];
+ }
}
};
View
@@ -67,14 +67,14 @@ This project started as a Chrome extension. For more info see the [wiki](http://
* the WebKit Web Inspector debugger is a great js debugger interface, it works just as well for node
* uses a WebSocket to connect to debug-agent, so no polling for breaks
+* remote debugging
* javascript top to bottom :)
## Known Issues
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 710b3c2

Please sign in to comment.