feat(transiler/dart): re-export imported vars

```
import {Foo} from ‘./foo’;
var localVar = true;
export {Foo, localVar};

===>

import ‘./foo’ show Foo;
export ‘./foo’ show Foo;
var localVar = true;
```

Closes #41
This commit is contained in:
Vojta Jina
2014-11-10 17:18:30 -08:00
parent c5153175b6
commit c68e78075a
6 changed files with 163 additions and 26 deletions

View File

@ -0,0 +1 @@
export var Baz = 'BAZ';

View File

@ -9,8 +9,14 @@ import * as exportModule from './export';
import {Type} from 'facade/lang';
import {Baz} from './reexport';
export function main() {
describe('imports', function() {
it('should re-export imported vars', function() {
expect(Baz).toBe('BAZ');
});
it('should work', function() {
expect(Foo).toBe('FOO');
expect(Bar).toBe('BAR');

View File

@ -0,0 +1,10 @@
import {Baz} from './baz';
import {Bar1} from './bar';
var localVar = true;
export {Baz, localVar, Bar1};
// Will become:
// export {Baz} from './baz';
// export {Bar1} from './bar';