diff --git a/src/utils/lazy.ts b/src/utils/lazy.ts index c3cb0f794..57e68398f 100644 --- a/src/utils/lazy.ts +++ b/src/utils/lazy.ts @@ -78,11 +78,7 @@ export function proxyLazy(factory: () => T, attempts = 5, isChild if (!isChild) setTimeout(() => isSameTick = false, 0); // Define the function in an object to preserve the name after minification - const dummyObj = { - ProxyDummy() { } - } as { ProxyDummy: any; }; - - const proxyDummy = dummyObj.ProxyDummy; + const proxyDummy = ({ ProxyDummy() { } }).ProxyDummy; Object.assign(proxyDummy, { [proxyLazyGet]() { if (!proxyDummy[proxyLazyCache]) { @@ -105,8 +101,6 @@ export function proxyLazy(factory: () => T, attempts = 5, isChild [proxyLazyCache]: void 0 as T | undefined }); - delete dummyObj.ProxyDummy; - const proxy = new Proxy(proxyDummy, { ...handler, get(target, p) { diff --git a/src/utils/proxyInner.ts b/src/utils/proxyInner.ts index 4f6c67991..76eb06f1e 100644 --- a/src/utils/proxyInner.ts +++ b/src/utils/proxyInner.ts @@ -59,11 +59,7 @@ export function proxyInner( if (!isChild) setTimeout(() => isSameTick = false, 0); // Define the function in an object to preserve the name after minification - const dummyObj = { - ProxyDummy() { } - } as { ProxyDummy: any; }; - - const proxyDummy = dummyObj.ProxyDummy; + const proxyDummy = ({ ProxyDummy() { } }).ProxyDummy; Object.assign(proxyDummy, { [proxyInnerGet]: function () { if (proxyDummy[proxyInnerValue] == null) { @@ -75,8 +71,6 @@ export function proxyInner( [proxyInnerValue]: void 0 as T | undefined }); - delete dummyObj.ProxyDummy; - const proxy = new Proxy(proxyDummy, { ...handler, get(target, p) {