diff --git a/test/function/deshadow-top-level-declaration/_config.js b/test/function/deshadow-top-level-declaration/_config.js new file mode 100644 index 0000000..1436240 --- /dev/null +++ b/test/function/deshadow-top-level-declaration/_config.js @@ -0,0 +1,4 @@ +module.exports = { + solo: true, + description: 'deshadows top-level declarations' +}; diff --git a/test/function/deshadow-top-level-declaration/a.js b/test/function/deshadow-top-level-declaration/a.js new file mode 100644 index 0000000..6637a3b --- /dev/null +++ b/test/function/deshadow-top-level-declaration/a.js @@ -0,0 +1 @@ +import './x'; diff --git a/test/function/deshadow-top-level-declaration/b.js b/test/function/deshadow-top-level-declaration/b.js new file mode 100644 index 0000000..b3defb1 --- /dev/null +++ b/test/function/deshadow-top-level-declaration/b.js @@ -0,0 +1,5 @@ +import { foo as _foo } from './foo'; + +export default function foo () { + _foo(); +} diff --git a/test/function/deshadow-top-level-declaration/foo.js b/test/function/deshadow-top-level-declaration/foo.js new file mode 100644 index 0000000..b0ff512 --- /dev/null +++ b/test/function/deshadow-top-level-declaration/foo.js @@ -0,0 +1,3 @@ +function foo () {} + +export { foo }; diff --git a/test/function/deshadow-top-level-declaration/main.js b/test/function/deshadow-top-level-declaration/main.js new file mode 100644 index 0000000..bf49817 --- /dev/null +++ b/test/function/deshadow-top-level-declaration/main.js @@ -0,0 +1,5 @@ +import './foo'; +import './a'; +import b from './b'; + +assert.equal( typeof b, 'function' ); diff --git a/test/function/deshadow-top-level-declaration/x.js b/test/function/deshadow-top-level-declaration/x.js new file mode 100644 index 0000000..9d78d8d --- /dev/null +++ b/test/function/deshadow-top-level-declaration/x.js @@ -0,0 +1,5 @@ +import { foo } from './foo'; + +function x () { + foo(); +}