mirror of https://github.com/lukechilds/rollup.git
Rich Harris
10 years ago
6 changed files with 69 additions and 0 deletions
@ -0,0 +1,11 @@ |
|||
import B from './B'; |
|||
|
|||
export default class A { |
|||
constructor () { |
|||
this.isA = true; |
|||
} |
|||
|
|||
b () { |
|||
return new B(); |
|||
} |
|||
} |
@ -0,0 +1,8 @@ |
|||
import A from './A'; |
|||
|
|||
export default class B extends A { |
|||
constructor () { |
|||
super(); |
|||
this.isB = true; |
|||
} |
|||
} |
@ -0,0 +1,8 @@ |
|||
import D from './D'; |
|||
|
|||
export default class C extends D { |
|||
constructor () { |
|||
super(); |
|||
this.isC = true; |
|||
} |
|||
} |
@ -0,0 +1,11 @@ |
|||
import C from './C'; |
|||
|
|||
export default class D { |
|||
constructor () { |
|||
this.isD = true; |
|||
} |
|||
|
|||
c () { |
|||
return new C(); |
|||
} |
|||
} |
@ -0,0 +1,19 @@ |
|||
var assert = require( 'assert' ); |
|||
|
|||
module.exports = { |
|||
description: 'resolves pathological cyclical dependencies gracefully', |
|||
babel: true, |
|||
exports: function ( exports ) { |
|||
assert.ok( exports.a.isA ); |
|||
assert.ok( exports.b1.isA ); |
|||
assert.ok( exports.b1.isB ); |
|||
assert.ok( exports.b2.isA ); |
|||
assert.ok( exports.b2.isB ); |
|||
assert.ok( exports.c1.isC ); |
|||
assert.ok( exports.c1.isD ); |
|||
assert.ok( exports.c2.isC ); |
|||
assert.ok( exports.c2.isD ); |
|||
assert.ok( exports.d.isD ); |
|||
}, |
|||
solo: true |
|||
}; |
@ -0,0 +1,12 @@ |
|||
import A from './A'; |
|||
import B from './B'; |
|||
|
|||
import C from './C'; |
|||
import D from './D'; |
|||
|
|||
export const a = new A(); |
|||
export const b1 = a.b(); |
|||
export const b2 = new B(); |
|||
export const c1 = new C(); |
|||
export const d = new D(); |
|||
export const c2 = d.c(); |
Loading…
Reference in new issue