You are reading a single comment by @luwar and its replies. Click here to read the full conversation.
  • The following module code throws an exception:

    // 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, .

    Any ideas?

About

Avatar for luwar @luwar started