diff --git a/test/function/top-level-side-effects-are-preserved/_config.js b/test/function/top-level-side-effects-are-preserved/_config.js new file mode 100644 index 0000000..b121b33 --- /dev/null +++ b/test/function/top-level-side-effects-are-preserved/_config.js @@ -0,0 +1,3 @@ +module.exports = { + description: 'top level side effects are preserved' +}; diff --git a/test/function/top-level-side-effects-are-preserved/asap.js b/test/function/top-level-side-effects-are-preserved/asap.js new file mode 100644 index 0000000..6b43f3a --- /dev/null +++ b/test/function/top-level-side-effects-are-preserved/asap.js @@ -0,0 +1 @@ +export default function asap() {} diff --git a/test/function/top-level-side-effects-are-preserved/config.js b/test/function/top-level-side-effects-are-preserved/config.js new file mode 100644 index 0000000..c4470d2 --- /dev/null +++ b/test/function/top-level-side-effects-are-preserved/config.js @@ -0,0 +1 @@ +export const config = {}; diff --git a/test/function/top-level-side-effects-are-preserved/defer.js b/test/function/top-level-side-effects-are-preserved/defer.js new file mode 100644 index 0000000..2ab1d6d --- /dev/null +++ b/test/function/top-level-side-effects-are-preserved/defer.js @@ -0,0 +1,5 @@ +import { config } from './config'; + +export default function defer() { + config.async(); +} diff --git a/test/function/top-level-side-effects-are-preserved/main.js b/test/function/top-level-side-effects-are-preserved/main.js new file mode 100644 index 0000000..d844cc0 --- /dev/null +++ b/test/function/top-level-side-effects-are-preserved/main.js @@ -0,0 +1,3 @@ +import { defer } from './rsvp'; + +defer(); diff --git a/test/function/top-level-side-effects-are-preserved/rsvp.js b/test/function/top-level-side-effects-are-preserved/rsvp.js new file mode 100644 index 0000000..d3bcb42 --- /dev/null +++ b/test/function/top-level-side-effects-are-preserved/rsvp.js @@ -0,0 +1,7 @@ +import { config } from './config'; +import asap from './asap'; +import defer from './defer'; + +config.async = asap; + +export { defer };