You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Name cache renames an undeclared global in a module #1753
Running b.js throws ReferenceError: o is not defined.
Expected result
b.js keeps process.platform. It never declares process, so that is the global.
With a name cache, an undeclared global takes whatever name the cache holds for it. For scripts that is the point, since they share one global scope. In a module the toplevel scope is not the global scope, so the name a.js cached for its import can never be what process means in b.js. #165 was the same problem for import and export names, fixed in #166.
Sharing one cache across modules is what --mangle-props needs to keep property names consistent, and the variable names come along. It then takes one module importing a name that another module uses as a global, like process, crypto, or Buffer from the node: modules.
Activity