aboutsummaryrefslogtreecommitdiff
path: root/test/mocha/ie8.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-06-06 17:50:56 +0800
committerGitHub <noreply@github.com>2018-06-06 17:50:56 +0800
commit9e19e63551907be19c8c6b5b75217d7650504436 (patch)
tree9c545c0e02d16c73a19c96f44b191af4f1eaff0e /test/mocha/ie8.js
parentbce7ee5f6a28e87e2e68cd2d22b4e4280372d7bb (diff)
downloadtracifyjs-9e19e63551907be19c8c6b5b75217d7650504436.tar.gz
tracifyjs-9e19e63551907be19c8c6b5b75217d7650504436.zip
general clean-ups (#3175)
Diffstat (limited to 'test/mocha/ie8.js')
-rw-r--r--test/mocha/ie8.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/mocha/ie8.js b/test/mocha/ie8.js
new file mode 100644
index 00000000..8f3a27fa
--- /dev/null
+++ b/test/mocha/ie8.js
@@ -0,0 +1,21 @@
+var assert = require("assert");
+var uglify = require("../../");
+
+describe("ie8", function() {
+ it("Should be able to minify() with undefined as catch parameter in a try...catch statement", function() {
+ assert.strictEqual(
+ uglify.minify([
+ "function a(b){",
+ " try {",
+ " throw 'Stuff';",
+ " } catch (undefined) {",
+ " console.log('caught: ' + undefined);",
+ " }",
+ " console.log('undefined is ' + undefined);",
+ " return b === undefined;",
+ "};",
+ ].join("\n")).code,
+ 'function a(o){try{throw"Stuff"}catch(o){console.log("caught: "+o)}return console.log("undefined is "+void 0),void 0===o}'
+ );
+ });
+});