aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRichard van Velzen <rvanvelzen1@gmail.com>2015-01-31 13:22:07 +0100
committerRichard van Velzen <rvanvelzen1@gmail.com>2015-01-31 13:24:44 +0100
commit605362f89da444e46bae35e7f9384b5cba2eeb80 (patch)
tree192b5d82ce328f5d7b2ba1dbd43ed2e090843f29 /test
parentfbbaa42ee55a7f753f7cab9b1a905ccf73cf26d5 (diff)
downloadtracifyjs-605362f89da444e46bae35e7f9384b5cba2eeb80.tar.gz
tracifyjs-605362f89da444e46bae35e7f9384b5cba2eeb80.zip
Drop all `console` statements properly
Because the base reference can be an member expression as well, we have to dig a bit deeper to find the leftmost base reference. Fixes #451
Diffstat (limited to 'test')
-rw-r--r--test/compress/drop-console.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/compress/drop-console.js b/test/compress/drop-console.js
new file mode 100644
index 00000000..162b339c
--- /dev/null
+++ b/test/compress/drop-console.js
@@ -0,0 +1,24 @@
+drop_console_1: {
+ options = {};
+ input: {
+ console.log('foo');
+ console.log.apply(console, arguments);
+ }
+ expect: {
+ console.log('foo');
+ console.log.apply(console, arguments);
+ }
+}
+
+drop_console_1: {
+ options = { drop_console: true };
+ input: {
+ console.log('foo');
+ console.log.apply(console, arguments);
+ }
+ expect: {
+ // with regular compression these will be stripped out as well
+ void 0;
+ void 0;
+ }
+}