Skip to content

util.inspect({level: "info"}) exits the debug session #4440

@learnerbyheart

Description

@learnerbyheart

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    utilIssues and PRs related to the built-in util module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions