diff --git a/test/function/shadowed-namespace/_config.js b/test/function/shadowed-namespace/_config.js new file mode 100644 index 0000000..f0d7f7a --- /dev/null +++ b/test/function/shadowed-namespace/_config.js @@ -0,0 +1,3 @@ +module.exports = { + description: 'namespaces are not shadowed' +}; diff --git a/test/function/shadowed-namespace/bar.js b/test/function/shadowed-namespace/bar.js new file mode 100644 index 0000000..a337d96 --- /dev/null +++ b/test/function/shadowed-namespace/bar.js @@ -0,0 +1,3 @@ +export function foo () { + return 'FUBAR'; +} diff --git a/test/function/shadowed-namespace/main.js b/test/function/shadowed-namespace/main.js new file mode 100644 index 0000000..c3eee67 --- /dev/null +++ b/test/function/shadowed-namespace/main.js @@ -0,0 +1,13 @@ +import * as bar from './bar'; + +function car () { + var bar = { + foo: function () { + return 42; + } + }; + return bar.foo(); +} + +assert.equal( bar.foo(), 'FUBAR' ); +assert.equal( car(), 42 );