aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-04-07 15:39:59 +0800
committerGitHub <noreply@github.com>2017-04-07 15:39:59 +0800
commite3c9c22c757112327b83f598b124690baf13ac52 (patch)
treeef0f12fae9fedb217b2a0b7219f95bbc9fb6511e /test
parent0f4cd73dcc5d8a936ae3630a7992dbcb44274136 (diff)
downloadtracifyjs-e3c9c22c757112327b83f598b124690baf13ac52.tar.gz
tracifyjs-e3c9c22c757112327b83f598b124690baf13ac52.zip
fix corner cases with `delete` (#1796)
`delete Infinity` returns `false` where as `delete (1/0)` returns `true`
Diffstat (limited to 'test')
-rw-r--r--test/compress/evaluate.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js
index fa432c46..e660071d 100644
--- a/test/compress/evaluate.js
+++ b/test/compress/evaluate.js
@@ -857,3 +857,26 @@ issue_1760_2: {
}
expect_stdout: "Infinity"
}
+
+delete_expr: {
+ options = {
+ evaluate: true,
+ }
+ input: {
+ console.log(delete undefined);
+ console.log(delete void 0);
+ console.log(delete Infinity);
+ console.log(delete (1 / 0));
+ console.log(delete NaN);
+ console.log(delete (0 / 0));
+ }
+ expect: {
+ console.log(delete undefined);
+ console.log(delete void 0);
+ console.log(delete Infinity);
+ console.log(delete (1 / 0));
+ console.log(delete NaN);
+ console.log(delete (0 / 0));
+ }
+ expect_stdout: true
+}