When debugging in node.js 5.3.0 the script bug.js
var util = require('util');
util.inspect({level: "info "});
console.log("Test");
with node debug bug.js, the debugging session exits. I tried the same in node.js 4.2.4 and it doesn't. When debugging the difference in lib/util.js, line 324 in 5.3.0 looks like this:
var promiseInternals = inspectPromise(value);
and line 319 in 4.2.4 looks like:
var promiseInternals = value instanceof Promise && inspectPromise(value);
As value is not an instance of Promise, inspectPromise(value) is called in 5.3.0. Then inspectPromise calls ensureDebugIsInitialized() which on the other hand calls require('vm').runInDebugContext('Debug'). This causes the debugging session to exit. The issue was tested in Ubuntu 14.04 LTS.
When debugging in node.js 5.3.0 the script
bug.jswith
node debug bug.js, the debugging session exits. I tried the same in node.js 4.2.4 and it doesn't. When debugging the difference inlib/util.js, line 324 in 5.3.0 looks like this:and line 319 in 4.2.4 looks like:
As value is not an instance of Promise,
inspectPromise(value)is called in 5.3.0. TheninspectPromisecallsensureDebugIsInitialized()which on the other hand callsrequire('vm').runInDebugContext('Debug'). This causes the debugging session to exit. The issue was tested in Ubuntu 14.04 LTS.