Skip to content

inspector: fix inspector open when there are sessions

fix inspector.open when there are sessions.

const { Session, open } = require('inspector');
const session = new Session();
session.connect();
open();

this code above will throw an error ERR_INSPECTOR_ALREADY_ACTIVATED, but the following code works.

const { Session, open } = require('inspector');
const session = new Session();
open();
session.connect();

i think we should only throw ERR_INSPECTOR_ALREADY_ACTIVATED when there is a inspector thread 🤔.

Refs: https://github.com/nodejs/node/pull/33015 cc @joyeecheung

  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading