mirror of https://github.com/lukechilds/rollup.git
Rich Harris
9 years ago
7 changed files with 49 additions and 24 deletions
@ -0,0 +1,30 @@ |
|||
export class Reference { |
|||
constructor ( node, scope, statement ) { |
|||
this.node = node; |
|||
this.scope = scope; |
|||
this.statement = statement; |
|||
|
|||
this.declaration = null; // bound later
|
|||
|
|||
this.parts = []; |
|||
|
|||
let root = node; |
|||
while ( root.type === 'MemberExpression' ) { |
|||
this.parts.unshift( root.property.name ); |
|||
root = root.object; |
|||
} |
|||
|
|||
this.name = root.name; |
|||
|
|||
this.start = node.start; |
|||
this.end = node.start + this.name.length; // can be overridden in the case of namespace members
|
|||
this.rewritten = false; |
|||
} |
|||
} |
|||
|
|||
export class SyntheticReference { |
|||
constructor ( name ) { |
|||
this.name = name; |
|||
this.parts = []; |
|||
} |
|||
} |
@ -0,0 +1,3 @@ |
|||
module.exports = { |
|||
description: 'imports as- chained exports' |
|||
}; |
@ -0,0 +1 @@ |
|||
export var value = 42; |
@ -0,0 +1,5 @@ |
|||
import * as second from './second'; |
|||
|
|||
assert.equal( second.first.value, 42 ); |
|||
console.log( 'second', second ) |
|||
assert.deepEqual( second, { first: { value: 42 } }); |
@ -0,0 +1,2 @@ |
|||
import * as first from './first'; |
|||
export { first }; |
Loading…
Reference in new issue