[EDITED]
Input
module X.M {
export var x = false;
function q(M) {
}
M.x = true;
}
Output
var X;
(function (X) {
(function (_M) {
_M.x = false;
function q(M) {
}
M.x = true; // <--- crash, M is not bound to X.M yet. Should we use _M instead?
})(X.M || (X.M = {}));
var M = X.M;
})(X || (X = {}));
I'm not sure if the correct fix is to codegen _M at that line, or to not bump the module's parameter name to _M because of the function parameter name.
[EDITED]
Input
Output
I'm not sure if the correct fix is to codegen _M at that line, or to not bump the module's parameter name to _M because of the function parameter name.