fix(compiler): lower variables with a closure by exporting the variable.
This e.g. leaves comments at the right place, which is important for closure.
This commit is contained in:

committed by
Matias Niemelä

parent
b6833d1bbd
commit
5ef6e6366f
@ -28,6 +28,11 @@ describe('Expression lowering', () => {
|
||||
class MyClass {}
|
||||
`)).toContain('const l = () => null; exports.l = l;');
|
||||
});
|
||||
|
||||
it('should be able to export a variable if the whole value is lowered', () => {
|
||||
expect(convert('/*a*/ const a =◊b: () => null◊;'))
|
||||
.toBe('/*a*/ const a = () => null; const b = a; export { b };');
|
||||
});
|
||||
});
|
||||
|
||||
describe('collector', () => {
|
||||
|
Reference in New Issue
Block a user