diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-01-06 21:04:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-06 21:04:47 +0800 |
commit | 3564b4f20dfd2ec06dd162ce5c22b1b3f2e03c7f (patch) | |
tree | b23de8cb9335c54831f00c5bb12d3ac14f174aa0 /test | |
parent | 3505a3604a682138512a7e03964fb68c861b5cbd (diff) | |
download | tracifyjs-3564b4f20dfd2ec06dd162ce5c22b1b3f2e03c7f.tar.gz tracifyjs-3564b4f20dfd2ec06dd162ce5c22b1b3f2e03c7f.zip |
compress `RegExp()` in `unsafe` (#2735)
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/issue-269.js | 24 |
1 files changed, 24 insertions, 0 deletions
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]', + ] +} |