Terser: Mangle properties with regex doesn't handle `in` operator

Created on 4 Jul 2020  路  3Comments  路  Source: terser/terser

Bug report or Feature request? Bug report

Version 4.8.0

Complete CLI command or minify() options used

{
  mangle: {
    properties: {
      regex: /^_internal_/
    }
  },
}

terser input

var obj = { _internal_foo: 123 };
if ('_internal_foo' in obj) {
  console.log(123)
}

terser output or error

var obj={o:123};"_internal_foo"in obj&&console.log(123);

Expected result

var obj={o:123};"o"in obj&&console.log(123);
bug

All 3 comments

interesting!

Thanks for reporting this.

It took a while, but it's in Terser 5 now.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings