Fix an issue for patching
This commit is contained in:
parent
9ebfbdc894
commit
4cfba71c16
|
@ -37,14 +37,20 @@ export default function () {
|
|||
instance.push([[Symbol()], {}, require => {
|
||||
require.d = (target, exports) => {
|
||||
for (const key in exports) {
|
||||
if (!Reflect.has(exports, key) || target[key]) continue;
|
||||
|
||||
Object.defineProperty(target, key, {
|
||||
get: () => exports[key](),
|
||||
set: v => {exports[key] = () => v;},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
if (!Reflect.has(exports, key)) continue;
|
||||
|
||||
try {
|
||||
Object.defineProperty(target, key, {
|
||||
get: () => exports[key](),
|
||||
set: v => {exports[key] = () => v;},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
};
|
||||
}]);
|
||||
|
|
Loading…
Reference in New Issue