From 3564b4f20dfd2ec06dd162ce5c22b1b3f2e03c7f Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sat, 6 Jan 2018 21:04:47 +0800 Subject: compress `RegExp()` in `unsafe` (#2735) --- test/compress/issue-269.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test/compress') diff --git a/test/compress/issue-269.js b/test/compress/issue-269.js index 1d41dea6..a29e7541 100644 --- a/test/compress/issue-269.js +++ b/test/compress/issue-269.js @@ -64,3 +64,27 @@ strings_concat: { ); } } + +regexp: { + options = { + evaluate: true, + unsafe: true, + } + input: { + RegExp("foo"); + RegExp("bar", "ig"); + RegExp(foo); + RegExp("bar", ig); + RegExp("should", "fail"); + } + expect: { + /foo/; + /bar/ig; + RegExp(foo); + RegExp("bar", ig); + RegExp("should", "fail"); + } + expect_warnings: [ + 'WARN: Error converting RegExp("should","fail") [test/compress/issue-269.js:78,2]', + ] +} -- cgit v1.2.3