Skip to content

deps: upgrade to cjs-module-lexer@0.5.0

This upgrades to cjs-module-lexer@0.5.0 which filters CJS named exports detection to not detect getter properties like:

Object.defineProperty(exports, 'prop', {
  get () {
    throw new Error('error');
  }
});

The filtering is entirely handled by the lexer no longer emitting this case, while making an exception for __esModule.

Fixes https://github.com/nodejs/node/issues/35859.

As a result, these cases which previously would be detected as named exports no longer come up as named exports, but it is a relatively minor edge case we expect.

Since the cases that this affects are relatively minor, and since this feature is still experimental we do not need to treat this as formally breaking and should instead aim to get this out asap to maximise compatibility.

Requesting to fast track this PR, please give a thumbs up or thumbs down here to help push it through.

@nodejs/modules-active-members

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

Merge request reports

Loading