[cjs] Skip duplicate reexported bindings in namespace reexports (#11739)

This commit is contained in:
Niklas Mischkulnig
2020-09-28 16:22:13 +02:00
committed by GitHub
parent 39a12674b4
commit a080c82777
17 changed files with 26 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ define(["exports", "foo"], function (_exports, _foo) {
});
Object.keys(_foo).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in _exports && _exports[key] === _foo[key]) return;
Object.defineProperty(_exports, key, {
enumerable: true,
get: function () {

View File

@@ -4,6 +4,7 @@ define(["exports", "foo"], function (_exports, _foo) {
_exports.__esModule = true;
Object.keys(_foo).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in _exports && _exports[key] === _foo[key]) return;
_exports[key] = _foo[key];
});
});