Merge branch 'immediate-finds' into immediate-finds-modules-proxy
This commit is contained in:
commit
d55770797a
|
@ -56,8 +56,9 @@ const handler: ProxyHandler<any> = {
|
|||
return keys;
|
||||
},
|
||||
getOwnPropertyDescriptor: (target, p) => {
|
||||
if (typeof p === "string" && UNCONFIGURABLE_PROPERTIES.includes(p))
|
||||
if (typeof p === "string" && UNCONFIGURABLE_PROPERTIES.includes(p)) {
|
||||
return Reflect.getOwnPropertyDescriptor(target, p);
|
||||
}
|
||||
|
||||
const descriptor = Reflect.getOwnPropertyDescriptor(target[SYM_LAZY_GET](), p);
|
||||
if (descriptor) Object.defineProperty(target, p, descriptor);
|
||||
|
@ -79,9 +80,7 @@ export function proxyLazy<T = AnyObject>(factory: () => T, attempts = 5, isChild
|
|||
let isSameTick = true;
|
||||
if (!isChild) setTimeout(() => isSameTick = false, 0);
|
||||
|
||||
// Define the function in an object to preserve the name after minification
|
||||
const proxyDummy = ({ ProxyDummy() { } }).ProxyDummy;
|
||||
Object.assign(proxyDummy, {
|
||||
const proxyDummy = Object.assign(function () { }, {
|
||||
[SYM_LAZY_GET]() {
|
||||
if (!proxyDummy[SYM_LAZY_CACHED]) {
|
||||
if (!get.$$vencordLazyFailed()) {
|
||||
|
|
|
@ -31,8 +31,9 @@ const handler: ProxyHandler<any> = {
|
|||
return keys;
|
||||
},
|
||||
getOwnPropertyDescriptor: (target, p) => {
|
||||
if (typeof p === "string" && UNCONFIGURABLE_PROPERTIES.includes(p))
|
||||
if (typeof p === "string" && UNCONFIGURABLE_PROPERTIES.includes(p)) {
|
||||
return Reflect.getOwnPropertyDescriptor(target, p);
|
||||
}
|
||||
|
||||
const descriptor = Reflect.getOwnPropertyDescriptor(target[SYM_PROXY_INNER_GET](), p);
|
||||
if (descriptor) Object.defineProperty(target, p, descriptor);
|
||||
|
@ -56,9 +57,7 @@ export function proxyInner<T = AnyObject>(
|
|||
let isSameTick = true;
|
||||
if (!isChild) setTimeout(() => isSameTick = false, 0);
|
||||
|
||||
// Define the function in an object to preserve the name after minification
|
||||
const proxyDummy = ({ ProxyDummy() { } }).ProxyDummy;
|
||||
Object.assign(proxyDummy, {
|
||||
const proxyDummy = Object.assign(function () { }, {
|
||||
[SYM_PROXY_INNER_GET]: function () {
|
||||
if (proxyDummy[SYM_PROXY_INNER_VALUE] == null) {
|
||||
throw new Error(errMsg);
|
||||
|
|
Loading…
Reference in a new issue