Skip to content

NODE_V8_COVERAGE not output when Error thrown during initialization #29570

Closed
@bcoe

Description

@bcoe
  • Version: 12.0.0 -> 12.9.1.
  • Platform: OSX
  • Subsystem: coverage/process

Sometime between node@v11.15.0 and node@12.0.0 , NODE_V8_COVERAGE seems to have stopped outputting if a script throws in the first tick, as an example:

throw Error('error');
if (true) {
  console.info('hello world');
} else {
  console.info('goodnight moon');
}

This script will output coverage:

process.exit(1);
if (true) {
  console.info('hello world');
} else {
  console.info('goodnight moon');
}

I've noticed, similarly, that prepareStackTrace appears to not be called, which is why I'm using timeouts in the tests here; I wonder if the root cause might be the same.

CC: @addaleax, @joyeecheung, @devsnek, @nodejs/testing

Metadata

Metadata

Assignees

No one assigned

    Labels

    coverageIssues and PRs related to native coverage support.inspectorIssues and PRs related to the V8 inspector protocol

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions