aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/evaluate.js43
-rw-r--r--test/compress/regexp.js14
2 files changed, 44 insertions, 13 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js
index 6eadbe51..98d0b8d6 100644
--- a/test/compress/evaluate.js
+++ b/test/compress/evaluate.js
@@ -237,22 +237,39 @@ unsafe_constant: {
unsafe: true,
}
input: {
- console.log(
- true.a,
- false.a,
- null.a,
- undefined.a
- );
+ console.log(true.a, false.a);
+ console.log(true.valueOf(), false.valueOf());
+ try {
+ console.log(null.a);
+ } catch (e) {
+ console.log("PASS");
+ }
+ try {
+ console.log(undefined.a);
+ } catch (e) {
+ console.log("PASS");
+ }
}
expect: {
- console.log(
- void 0,
- false.a,
- null.a,
- (void 0).a
- );
+ console.log(void 0, void 0);
+ console.log(true, false);
+ try {
+ console.log(null.a);
+ } catch (e) {
+ console.log("PASS");
+ }
+ try {
+ console.log((void 0).a);
+ } catch (e) {
+ console.log("PASS");
+ }
}
- expect_stdout: true
+ expect_stdout: [
+ "undefined undefined",
+ "true false",
+ "PASS",
+ "PASS",
+ ]
}
unsafe_object: {
diff --git a/test/compress/regexp.js b/test/compress/regexp.js
index 6b93faba..460ff504 100644
--- a/test/compress/regexp.js
+++ b/test/compress/regexp.js
@@ -36,6 +36,20 @@ regexp_2: {
expect_stdout: '["PASS","pass"]'
}
+regexp_properties: {
+ options = {
+ evaluate: true,
+ unsafe: true,
+ }
+ input: {
+ console.log(/abc/g.source, /abc/g.global, /abc/g.ignoreCase, /abc/g.lastIndex, /abc/g.multiline);
+ }
+ expect: {
+ console.log("abc", true, false, /abc/g.lastIndex, false);
+ }
+ expect_stdout: "abc true false 0 false"
+}
+
issue_3434_1: {
options = {
evaluate: true,