aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-01-06 21:04:47 +0800
committerGitHub <noreply@github.com>2018-01-06 21:04:47 +0800
commit3564b4f20dfd2ec06dd162ce5c22b1b3f2e03c7f (patch)
treeb23de8cb9335c54831f00c5bb12d3ac14f174aa0 /test
parent3505a3604a682138512a7e03964fb68c861b5cbd (diff)
downloadtracifyjs-3564b4f20dfd2ec06dd162ce5c22b1b3f2e03c7f.tar.gz
tracifyjs-3564b4f20dfd2ec06dd162ce5c22b1b3f2e03c7f.zip
compress `RegExp()` in `unsafe` (#2735)
Diffstat (limited to 'test')
-rw-r--r--test/compress/issue-269.js24
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]',
+ ]
+}