From 9fa5e5e783849c04cb143ea8122713e6ece63ff7 Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Sun, 4 Oct 2015 23:05:09 -0400 Subject: [PATCH] screwy deshadowing logic - failing test case --- test/function/deshadow-top-level-declaration/_config.js | 4 ++++ test/function/deshadow-top-level-declaration/a.js | 1 + test/function/deshadow-top-level-declaration/b.js | 5 +++++ test/function/deshadow-top-level-declaration/foo.js | 3 +++ test/function/deshadow-top-level-declaration/main.js | 5 +++++ test/function/deshadow-top-level-declaration/x.js | 5 +++++ 6 files changed, 23 insertions(+) create mode 100644 test/function/deshadow-top-level-declaration/_config.js create mode 100644 test/function/deshadow-top-level-declaration/a.js create mode 100644 test/function/deshadow-top-level-declaration/b.js create mode 100644 test/function/deshadow-top-level-declaration/foo.js create mode 100644 test/function/deshadow-top-level-declaration/main.js create mode 100644 test/function/deshadow-top-level-declaration/x.js 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(); +}