Skip to content

deps: upgrade to cjs-module-lexer@1.0.0

This updates to cjs-module-lexer@1.0.0, with some final getter refinements to fix https://github.com/nodejs/node/issues/35859.

To explain the getter handling story here:

  1. The initial fix was to disable getters entirely to avoid destructive behaviours on import
  2. This broke Babel strict reexports, so instead lexing just a safe subset of getters that return value properties, or getters for identifiers and member expressions was supported.
  3. It turns out the original issue in (1) was still not resolved because the code of pg has an unsafe getter function, which internally does an Object.defineProperty once called to set a value property, which was then being detected as one of these safe properties.

Thus this update includes the fix at https://github.com/guybedford/cjs-module-lexer/pull/29 which adds unsafe getter tracking to specifically mark unsafe getters and never emit them even if they later have safe getter forms.

I've verified this fixes the test case from https://github.com/nodejs/node/issues/35859.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Merge request reports

Loading