Advanced proxies

This commit is contained in:
ZXMushroom63 2024-10-01 14:02:44 +08:00
parent 25e34113d1
commit 9fd38d89d1

View File

@ -296,6 +296,15 @@ globalThis.modapi_postinit = "(" + (() => {
}
var reloadDeprecationWarnings = 0;
const TeaVM_to_BaseData_ProxyConf = {
ownKeys(target) {
return Reflect.ownKeys(target).flatMap(x => x.substring(1));
},
getOwnPropertyDescriptor(target, prop) {
return Object.getOwnPropertyDescriptor(target, "$" + prop);
},
has(target, prop) {
return ("$" + prop) in target;
},
get(target, prop, receiver) {
if (prop === "getRef") {
return function () {
@ -348,6 +357,15 @@ globalThis.modapi_postinit = "(" + (() => {
}
}
const TeaVM_to_Recursive_BaseData_ProxyConf = {
ownKeys(target) {
return Reflect.ownKeys(target).flatMap(x => x.substring(1));
},
getOwnPropertyDescriptor(target, prop) {
return Object.getOwnPropertyDescriptor(target, "$" + prop);
},
has(target, prop) {
return ("$" + prop) in target;
},
get(target, prop, receiver) {
if (prop === "getRef") {
return function () {