| | |
| | | def_eval(AST_BigInt, return_this); |
| | | |
| | | def_eval(AST_RegExp, function (compressor) { |
| | | let evaluated = compressor.evaluated_regexps.get(this); |
| | | let evaluated = compressor.evaluated_regexps.get(this.value); |
| | | if (evaluated === undefined) { |
| | | try { |
| | | evaluated = (0, eval)(this.print_to_string()); |
| | | const { source, flags } = this.value; |
| | | evaluated = new RegExp(source, flags); |
| | | } catch (e) { |
| | | evaluated = null; |
| | | } |
| | | compressor.evaluated_regexps.set(this, evaluated); |
| | | compressor.evaluated_regexps.set(this.value, evaluated); |
| | | } |
| | | return evaluated || this; |
| | | }); |