Hi,
While debugging nodejs code in VS, variables that hold object literals do not show any properties while examining on a break point. These objects are displayed as "no children", for example, when you hover your mouse over them in the code while debugging.
Comments: Thank you, dscher. This saved me a lot of time debugging :) Turns out that this is a bug introduced into Node by porting a single fix from upstream V8: https://github.com/joyent/node/commit/45f1330425b671905a02fe30ee7a1dd9544c2709 The important part of the change is `Enable "strict mode"; for debugger scripts`. Now that they did it, a bunch of stuff in that file no longer works at all. In particular, the following code, which is hit when looking up members of objects, is now broken: ```js DebugCommandProcessor.prototype.lookupRequest_ = function(request, response) { if (!request.arguments) { return response.failed('Missing arguments'); } // Pull out arguments. var handles = request.arguments.handles; // Check for legal arguments. if (IS_UNDEFINED(handles)) { return response.failed('Argument "handles" missing'); } // Set 'includeSource' option for script lookup. if (!IS_UNDEFINED(request.arguments.includeSource)) { includeSource = %ToBoolean(request.arguments.includeSource); response.setOption('includeSource', includeSource); } // Lookup handles. var mirrors = {}; for (var i = 0; i < handles.length; i++) { var handle = handles[i]; var mirror = LookupMirror(handle); if (!mirror) { return response.failed('Object #' + handle + '# not found'); } mirrors[handle] = mirror; } response.body = mirrors; }; ``` The bug is that `includeSource` is not declared with `var`. In strict mode, this causes a `ReferenceError`. There is other similar breakage caused by that change that they've since fixed, e.g. https://github.com/joyent/node/commit/0ff51c6e063e3eea9e4d9ea68edc82d935626fc7. There may well be more. For the time being, I would suggest sticking to v0.10.33 if you want debugging to work without glitches (in any Node IDE, as well as node-inspector, not just in NTVS). I'll report this to Node and hopefully we'll have a fix soon.
While debugging nodejs code in VS, variables that hold object literals do not show any properties while examining on a break point. These objects are displayed as "no children", for example, when you hover your mouse over them in the code while debugging.
Comments: Thank you, dscher. This saved me a lot of time debugging :) Turns out that this is a bug introduced into Node by porting a single fix from upstream V8: https://github.com/joyent/node/commit/45f1330425b671905a02fe30ee7a1dd9544c2709 The important part of the change is `Enable "strict mode"; for debugger scripts`. Now that they did it, a bunch of stuff in that file no longer works at all. In particular, the following code, which is hit when looking up members of objects, is now broken: ```js DebugCommandProcessor.prototype.lookupRequest_ = function(request, response) { if (!request.arguments) { return response.failed('Missing arguments'); } // Pull out arguments. var handles = request.arguments.handles; // Check for legal arguments. if (IS_UNDEFINED(handles)) { return response.failed('Argument "handles" missing'); } // Set 'includeSource' option for script lookup. if (!IS_UNDEFINED(request.arguments.includeSource)) { includeSource = %ToBoolean(request.arguments.includeSource); response.setOption('includeSource', includeSource); } // Lookup handles. var mirrors = {}; for (var i = 0; i < handles.length; i++) { var handle = handles[i]; var mirror = LookupMirror(handle); if (!mirror) { return response.failed('Object #' + handle + '# not found'); } mirrors[handle] = mirror; } response.body = mirrors; }; ``` The bug is that `includeSource` is not declared with `var`. In strict mode, this causes a `ReferenceError`. There is other similar breakage caused by that change that they've since fixed, e.g. https://github.com/joyent/node/commit/0ff51c6e063e3eea9e4d9ea68edc82d935626fc7. There may well be more. For the time being, I would suggest sticking to v0.10.33 if you want debugging to work without glitches (in any Node IDE, as well as node-inspector, not just in NTVS). I'll report this to Node and hopefully we'll have a fix soon.