function(a, b, c) {
a.foo = 1; // Used as expected
{
// A different scope!
let a = 5;
a = 6;
};
}
This project will replace globally in the whole file all occurrences of the symbol a, even in cases where the symbol is overwritten in a nested lexical context.
The above code will be transformed into:
function(module, exports, require) {
module.foo = 1; // Transformed as expected
{
// BAD! Should have kept those identifiers as `a`!
let module = 5;
module = 6;
};
}
Given a bundle that contains this module:
This project will replace globally in the whole file all occurrences of the symbol
a
, even in cases where the symbol is overwritten in a nested lexical context.The above code will be transformed into: