From 3db1236024346704706b7a02d2505c8bf183cf98 Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Sat, 14 Nov 2015 16:58:38 -0500 Subject: [PATCH] additional side effect test --- test/form/side-effect-l/_config.js | 3 +++ test/form/side-effect-l/_expected/amd.js | 5 +++++ test/form/side-effect-l/_expected/cjs.js | 1 + test/form/side-effect-l/_expected/es6.js | 0 test/form/side-effect-l/_expected/iife.js | 5 +++++ test/form/side-effect-l/_expected/umd.js | 9 +++++++++ test/form/side-effect-l/foo.js | 6 ++++++ test/form/side-effect-l/main.js | 1 + 8 files changed, 30 insertions(+) create mode 100644 test/form/side-effect-l/_config.js create mode 100644 test/form/side-effect-l/_expected/amd.js create mode 100644 test/form/side-effect-l/_expected/cjs.js create mode 100644 test/form/side-effect-l/_expected/es6.js create mode 100644 test/form/side-effect-l/_expected/iife.js create mode 100644 test/form/side-effect-l/_expected/umd.js create mode 100644 test/form/side-effect-l/foo.js create mode 100644 test/form/side-effect-l/main.js diff --git a/test/form/side-effect-l/_config.js b/test/form/side-effect-l/_config.js new file mode 100644 index 0000000..51f192c --- /dev/null +++ b/test/form/side-effect-l/_config.js @@ -0,0 +1,3 @@ +module.exports = { + description: 'discards function with no side-effects in imported module' +}; diff --git a/test/form/side-effect-l/_expected/amd.js b/test/form/side-effect-l/_expected/amd.js new file mode 100644 index 0000000..f9f8229 --- /dev/null +++ b/test/form/side-effect-l/_expected/amd.js @@ -0,0 +1,5 @@ +define(function () { 'use strict'; + + + +}); diff --git a/test/form/side-effect-l/_expected/cjs.js b/test/form/side-effect-l/_expected/cjs.js new file mode 100644 index 0000000..ad9a93a --- /dev/null +++ b/test/form/side-effect-l/_expected/cjs.js @@ -0,0 +1 @@ +'use strict'; diff --git a/test/form/side-effect-l/_expected/es6.js b/test/form/side-effect-l/_expected/es6.js new file mode 100644 index 0000000..e69de29 diff --git a/test/form/side-effect-l/_expected/iife.js b/test/form/side-effect-l/_expected/iife.js new file mode 100644 index 0000000..fe68252 --- /dev/null +++ b/test/form/side-effect-l/_expected/iife.js @@ -0,0 +1,5 @@ +(function () { 'use strict'; + + + +})(); diff --git a/test/form/side-effect-l/_expected/umd.js b/test/form/side-effect-l/_expected/umd.js new file mode 100644 index 0000000..c833540 --- /dev/null +++ b/test/form/side-effect-l/_expected/umd.js @@ -0,0 +1,9 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory() : + typeof define === 'function' && define.amd ? define(factory) : + factory(); +}(this, function () { 'use strict'; + + + +})); diff --git a/test/form/side-effect-l/foo.js b/test/form/side-effect-l/foo.js new file mode 100644 index 0000000..e37fcd7 --- /dev/null +++ b/test/form/side-effect-l/foo.js @@ -0,0 +1,6 @@ +export default function foo () { + bar(); + function bar () {} +} + +var x = foo(); diff --git a/test/form/side-effect-l/main.js b/test/form/side-effect-l/main.js new file mode 100644 index 0000000..025664b --- /dev/null +++ b/test/form/side-effect-l/main.js @@ -0,0 +1 @@ +import './foo.js';