Browse Source

failing test for #733

semi-dynamic-namespace-imports
Rich Harris 8 years ago
parent
commit
f6ac48283f
  1. 3
      test/function/export-two-ways-default/_config.js
  2. 6
      test/function/export-two-ways-default/bar.js
  3. 8
      test/function/export-two-ways-default/foo.js
  4. 4
      test/function/export-two-ways-default/main.js
  5. 6
      test/function/export-two-ways-default/x.js

3
test/function/export-two-ways-default/_config.js

@ -0,0 +1,3 @@
module.exports = {
description: 'side-effects are preserved if subject is exported in multiple ways (#733)'
};

6
test/function/export-two-ways-default/bar.js

@ -0,0 +1,6 @@
import { X } from './x.js'; // import X works
X.prototype.bar = function () {
console.log( 'bar' );
return this;
};

8
test/function/export-two-ways-default/foo.js

@ -0,0 +1,8 @@
export function X () {}
X.prototype.foo = function () {
console.log( 'foo' );
return this;
};
export default X; // export {X as Y} with corresponding export {Y as X} in x.js works

4
test/function/export-two-ways-default/main.js

@ -0,0 +1,4 @@
import { x } from './x.js';
import './bar.js';
x().foo().bar();

6
test/function/export-two-ways-default/x.js

@ -0,0 +1,6 @@
export { default as X } from './foo.js'; // export {X} works
import { X } from './foo.js'; // import X works
export function x () {
return new X();
}
Loading…
Cancel
Save