From e3c9c22c757112327b83f598b124690baf13ac52 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Fri, 7 Apr 2017 15:39:59 +0800 Subject: fix corner cases with `delete` (#1796) `delete Infinity` returns `false` where as `delete (1/0)` returns `true` --- test/compress/evaluate.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test') 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 +} -- cgit v1.2.3