compress RegExp() in unsafe (#2735)

This commit is contained in:
Alex Lam S.L
2018-01-06 21:04:47 +08:00
committed by GitHub
parent 3505a3604a
commit 3564b4f20d
2 changed files with 45 additions and 0 deletions

View File

@@ -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]',
]
}