// constructor function
function PengMod(a) {
// "a" will be resolved with the method a not with the locale variable a.
console.log( a );
if (a !== "hello" ) throw Error("Bug!");
}
// This function masks the local variable a in the constructor!!!
PengMod.a = function () {
};
new PengMod( "hello" );
The code is a snippet from a larger module which must be minified because of its size. I cannot rename the method oder variable because the names come from a minification step with name mangling. The transpiler always starts in every new scope with a, b, c, .
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The following module code throws an exception:
The code is a snippet from a larger module which must be minified because of its size. I cannot rename the method oder variable because the names come from a minification step with name mangling. The transpiler always starts in every new scope with a, b, c, .
Any ideas?