I'm seeing an issue where namespaces that are exposed as globals (e.g. via goog.exportSymbol) can get polluted (new keys are added to the global, or existing keys replaced with empty object) when imported by another Closure module. Example:
I would expect the output of app.js to be [1, 2, 1, undefined], but it is actually [1, 2, {}, 2]. I think that the root of the problem is that the module prefix generated by closure-loader uses deep-extend without an empty object as the first argument – so requiring any namespace that's available as a global may mutate it.
I'm seeing an issue where namespaces that are exposed as globals (e.g. via goog.exportSymbol) can get polluted (new keys are added to the global, or existing keys replaced with empty object) when imported by another Closure module. Example:
app.js:
foo.js
bar.js
I would expect the output of app.js to be
[1, 2, 1, undefined]
, but it is actually[1, 2, {}, 2]
. I think that the root of the problem is that the module prefix generated by closure-loader uses deep-extend without an empty object as the first argument – so requiring any namespace that's available as a global may mutate it.