Open
Description
Minimal reproduction follows:
test.ts
export module Foo {
const notAnEmptyModule = 6;
}
Output: test.js
var Foo;
(function (Foo) {
const /** @type {number} */ notAnEmptyModule = 6;
})(Foo = exports.Foo || (exports.Foo = {}));
Compiling with Closure Compiler v20180101 (the latest at the time of this writing) fails with this error:
vulcan/build/js/test.js:10: ERROR - Exports must be a statement at the top-level of a module
})(Foo = exports.Foo || (exports.Foo = {}));
^^^^^^^^^^^^^^^^
As a workaround, doing the export on a separate line generates working code:
module Foo {
const notAnEmptyModule = 6;
}
export {Foo};
Metadata
Metadata
Assignees
Labels
No labels