Browse Source

add another failing test for #733, but skip it for now

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

4
test/function/export-two-ways-default-b/_config.js

@ -0,0 +1,4 @@
module.exports = {
skip: true,
description: 'side-effects are preserved if subject is exported in multiple ways, even if default export has no direct link to original (#733)'
};

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

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

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

@ -0,0 +1,8 @@
export function X () {}
X.prototype.foo = function () {
this.didFoo = true;
return this;
};
export default ( false || X );

6
test/function/export-two-ways-default-b/main.js

@ -0,0 +1,6 @@
import { x } from './x.js';
import './bar.js';
var result = x().foo().bar();
assert.ok( result.didFoo );
assert.ok( result.didBar );

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

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

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

@ -1,4 +1,4 @@
import { X } from './x.js'; // import X works import { X } from './x.js';
X.prototype.bar = function () { X.prototype.bar = function () {
this.didBar = true; this.didBar = true;

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

@ -5,4 +5,4 @@ X.prototype.foo = function () {
return this; return this;
}; };
export default X; // export {X as Y} with corresponding export {Y as X} in x.js works export default X;

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

@ -1,5 +1,5 @@
export { default as X } from './foo.js'; // export {X} works export { default as X } from './foo.js';
import { X } from './foo.js'; // import X works import { X } from './foo.js';
export function x () { export function x () {
return new X(); return new X();

Loading…
Cancel
Save