Skip to content

util: prevent inspect tampering

This prevents entries from showing up twice if they were set with Object.defineProperty().

This is a bit tricky since setting these values hides relevent information. However, this is already the case and when inspecting the value with showHidden: true it visualizes these entries twice.

We might decide not to guard against this kind of tampering but I guess it does not hurt either.

It would also be possible to partially recover the original information and show that as well (e.g., the size property of a set or map). The question would be how to distinguish both properties, since they both would have the same name.

Checklist
  • 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