allow RegExp for unsafe_methods compress option (#2327)
This commit is contained in:
@@ -4867,7 +4867,10 @@ merge(Compressor.prototype, {
|
||||
// p:async function(){} ---> async p(){}
|
||||
// p:()=>{} ---> p(){}
|
||||
// p:async()=>{} ---> async p(){}
|
||||
if (compressor.option("unsafe_methods") && compressor.option("ecma") >= 6) {
|
||||
var unsafe_methods = compressor.option("unsafe_methods");
|
||||
if (unsafe_methods
|
||||
&& compressor.option("ecma") >= 6
|
||||
&& (!(unsafe_methods instanceof RegExp) || unsafe_methods.test(self.key + ""))) {
|
||||
var key = self.key;
|
||||
var value = self.value;
|
||||
var is_arrow_with_block = value instanceof AST_Arrow
|
||||
|
||||
Reference in New Issue
Block a user