{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/4440","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/4440/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/4440/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/4440/events","html_url":"https://github.com/nodejs/node/issues/4440","id":123994782,"number":4440,"title":"util.inspect({level: \"info\"}) exits the debug session","user":{"login":"LucasMoody","id":6631344,"avatar_url":"https://avatars.githubusercontent.com/u/6631344?v=3","gravatar_id":"","url":"https://api.github.com/users/LucasMoody","html_url":"https://github.com/LucasMoody","followers_url":"https://api.github.com/users/LucasMoody/followers","following_url":"https://api.github.com/users/LucasMoody/following{/other_user}","gists_url":"https://api.github.com/users/LucasMoody/gists{/gist_id}","starred_url":"https://api.github.com/users/LucasMoody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LucasMoody/subscriptions","organizations_url":"https://api.github.com/users/LucasMoody/orgs","repos_url":"https://api.github.com/users/LucasMoody/repos","events_url":"https://api.github.com/users/LucasMoody/events{/privacy}","received_events_url":"https://api.github.com/users/LucasMoody/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/debugger","name":"debugger","color":"bfd4f2"},{"url":"https://api.github.com/repos/nodejs/node/labels/util","name":"util","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":31,"created_at":"2015-12-27T20:14:59Z","updated_at":"2016-02-05T02:31:34Z","closed_at":null,"body":"When debugging in node.js 5.3.0 the script `bug.js`\r\n```javascript\r\nvar util = require('util');\r\nutil.inspect({level: \"info \"});\r\nconsole.log(\"Test\");\r\n```\r\n\r\nwith `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:\r\n\r\n```javascript\r\nvar promiseInternals = inspectPromise(value);\r\n```\r\n\r\nand line 319 in 4.2.4 looks like:\r\n\r\n```javascript\r\nvar promiseInternals = value instanceof Promise && inspectPromise(value);\r\n```\r\n\r\nAs 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."},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/180163428","html_url":"https://github.com/nodejs/node/issues/4440#issuecomment-180163428","issue_url":"https://api.github.com/repos/nodejs/node/issues/4440","id":180163428,"user":{"login":"atom0s","id":1422090,"avatar_url":"https://avatars.githubusercontent.com/u/1422090?v=3","gravatar_id":"","url":"https://api.github.com/users/atom0s","html_url":"https://github.com/atom0s","followers_url":"https://api.github.com/users/atom0s/followers","following_url":"https://api.github.com/users/atom0s/following{/other_user}","gists_url":"https://api.github.com/users/atom0s/gists{/gist_id}","starred_url":"https://api.github.com/users/atom0s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom0s/subscriptions","organizations_url":"https://api.github.com/users/atom0s/orgs","repos_url":"https://api.github.com/users/atom0s/repos","events_url":"https://api.github.com/users/atom0s/events{/privacy}","received_events_url":"https://api.github.com/users/atom0s/received_events","type":"User","site_admin":false},"created_at":"2016-02-05T02:31:34Z","updated_at":"2016-02-05T02:31:34Z","body":"Sadly downgrading is not an option for everyone. "}}