cya dummyObj
This commit is contained in:
parent
74f36a093b
commit
64212512ca
|
@ -78,11 +78,7 @@ export function proxyLazy<T = AnyObject>(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<T = AnyObject>(factory: () => T, attempts = 5, isChild
|
|||
[proxyLazyCache]: void 0 as T | undefined
|
||||
});
|
||||
|
||||
delete dummyObj.ProxyDummy;
|
||||
|
||||
const proxy = new Proxy(proxyDummy, {
|
||||
...handler,
|
||||
get(target, p) {
|
||||
|
|
|
@ -59,11 +59,7 @@ export function proxyInner<T = AnyObject>(
|
|||
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<T = AnyObject>(
|
|||
[proxyInnerValue]: void 0 as T | undefined
|
||||
});
|
||||
|
||||
delete dummyObj.ProxyDummy;
|
||||
|
||||
const proxy = new Proxy(proxyDummy, {
|
||||
...handler,
|
||||
get(target, p) {
|
||||
|
|
Loading…
Reference in a new issue