mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-11 13:30:02 -04:00
fix: calling event functions on proxied handlers
This commit is contained in:
parent
f68f9ac732
commit
3d4e9f90c2
3 changed files with 67 additions and 54 deletions
|
@ -48,8 +48,8 @@
|
|||
"@types/estree": "^1.0.7",
|
||||
"@types/node": "^22.15.3",
|
||||
"@types/serviceworker": "^0.0.132",
|
||||
"@typescript-eslint/eslint-plugin": "^8.31.0",
|
||||
"@typescript-eslint/parser": "^8.31.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.31.1",
|
||||
"@typescript-eslint/parser": "^8.31.1",
|
||||
"dotenv": "^16.5.0",
|
||||
"eslint": "^9.25.1",
|
||||
"fastify": "^5.3.2",
|
||||
|
|
102
pnpm-lock.yaml
generated
102
pnpm-lock.yaml
generated
|
@ -82,11 +82,11 @@ importers:
|
|||
specifier: ^0.0.132
|
||||
version: 0.0.132
|
||||
'@typescript-eslint/eslint-plugin':
|
||||
specifier: ^8.31.0
|
||||
version: 8.31.0(@typescript-eslint/parser@8.31.0(eslint@9.25.1)(typescript@5.8.3))(eslint@9.25.1)(typescript@5.8.3)
|
||||
specifier: ^8.31.1
|
||||
version: 8.31.1(@typescript-eslint/parser@8.31.1(eslint@9.25.1)(typescript@5.8.3))(eslint@9.25.1)(typescript@5.8.3)
|
||||
'@typescript-eslint/parser':
|
||||
specifier: ^8.31.0
|
||||
version: 8.31.0(eslint@9.25.1)(typescript@5.8.3)
|
||||
specifier: ^8.31.1
|
||||
version: 8.31.1(eslint@9.25.1)(typescript@5.8.3)
|
||||
dotenv:
|
||||
specifier: ^16.5.0
|
||||
version: 16.5.0
|
||||
|
@ -544,51 +544,51 @@ packages:
|
|||
'@types/ws@8.18.1':
|
||||
resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==}
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.31.0':
|
||||
resolution: {integrity: sha512-evaQJZ/J/S4wisevDvC1KFZkPzRetH8kYZbkgcTRyql3mcKsf+ZFDV1BVWUGTCAW5pQHoqn5gK5b8kn7ou9aFQ==}
|
||||
'@typescript-eslint/eslint-plugin@8.31.1':
|
||||
resolution: {integrity: sha512-oUlH4h1ABavI4F0Xnl8/fOtML/eu8nI2A1nYd+f+55XI0BLu+RIqKoCiZKNo6DtqZBEQm5aNKA20G3Z5w3R6GQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
'@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <5.9.0'
|
||||
|
||||
'@typescript-eslint/parser@8.31.0':
|
||||
resolution: {integrity: sha512-67kYYShjBR0jNI5vsf/c3WG4u+zDnCTHTPqVMQguffaWWFs7artgwKmfwdifl+r6XyM5LYLas/dInj2T0SgJyw==}
|
||||
'@typescript-eslint/parser@8.31.1':
|
||||
resolution: {integrity: sha512-oU/OtYVydhXnumd0BobL9rkJg7wFJ9bFFPmSmB/bf/XWN85hlViji59ko6bSKBXyseT9V8l+CN1nwmlbiN0G7Q==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <5.9.0'
|
||||
|
||||
'@typescript-eslint/scope-manager@8.31.0':
|
||||
resolution: {integrity: sha512-knO8UyF78Nt8O/B64i7TlGXod69ko7z6vJD9uhSlm0qkAbGeRUSudcm0+K/4CrRjrpiHfBCjMWlc08Vav1xwcw==}
|
||||
'@typescript-eslint/scope-manager@8.31.1':
|
||||
resolution: {integrity: sha512-BMNLOElPxrtNQMIsFHE+3P0Yf1z0dJqV9zLdDxN/xLlWMlXK/ApEsVEKzpizg9oal8bAT5Sc7+ocal7AC1HCVw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/type-utils@8.31.0':
|
||||
resolution: {integrity: sha512-DJ1N1GdjI7IS7uRlzJuEDCgDQix3ZVYVtgeWEyhyn4iaoitpMBX6Ndd488mXSx0xah/cONAkEaYyylDyAeHMHg==}
|
||||
'@typescript-eslint/type-utils@8.31.1':
|
||||
resolution: {integrity: sha512-fNaT/m9n0+dpSp8G/iOQ05GoHYXbxw81x+yvr7TArTuZuCA6VVKbqWYVZrV5dVagpDTtj/O8k5HBEE/p/HM5LA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <5.9.0'
|
||||
|
||||
'@typescript-eslint/types@8.31.0':
|
||||
resolution: {integrity: sha512-Ch8oSjVyYyJxPQk8pMiP2FFGYatqXQfQIaMp+TpuuLlDachRWpUAeEu1u9B/v/8LToehUIWyiKcA/w5hUFRKuQ==}
|
||||
'@typescript-eslint/types@8.31.1':
|
||||
resolution: {integrity: sha512-SfepaEFUDQYRoA70DD9GtytljBePSj17qPxFHA/h3eg6lPTqGJ5mWOtbXCk1YrVU1cTJRd14nhaXWFu0l2troQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/typescript-estree@8.31.0':
|
||||
resolution: {integrity: sha512-xLmgn4Yl46xi6aDSZ9KkyfhhtnYI15/CvHbpOy/eR5NWhK/BK8wc709KKwhAR0m4ZKRP7h07bm4BWUYOCuRpQQ==}
|
||||
'@typescript-eslint/typescript-estree@8.31.1':
|
||||
resolution: {integrity: sha512-kaA0ueLe2v7KunYOyWYtlf/QhhZb7+qh4Yw6Ni5kgukMIG+iP773tjgBiLWIXYumWCwEq3nLW+TUywEp8uEeag==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
typescript: '>=4.8.4 <5.9.0'
|
||||
|
||||
'@typescript-eslint/utils@8.31.0':
|
||||
resolution: {integrity: sha512-qi6uPLt9cjTFxAb1zGNgTob4x9ur7xC6mHQJ8GwEzGMGE9tYniublmJaowOJ9V2jUzxrltTPfdG2nKlWsq0+Ww==}
|
||||
'@typescript-eslint/utils@8.31.1':
|
||||
resolution: {integrity: sha512-2DSI4SNfF5T4oRveQ4nUrSjUqjMND0nLq9rEkz0gfGr3tg0S5KB6DhwR+WZPCjzkZl3cH+4x2ce3EsL50FubjQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <5.9.0'
|
||||
|
||||
'@typescript-eslint/visitor-keys@8.31.0':
|
||||
resolution: {integrity: sha512-QcGHmlRHWOl93o64ZUMNewCdwKGU6WItOU52H0djgNmn1EOrhVudrDzXz4OycCRSCPwFCDrE2iIt5vmuUdHxuQ==}
|
||||
'@typescript-eslint/visitor-keys@8.31.1':
|
||||
resolution: {integrity: sha512-I+/rgqOVBn6f0o7NDTmAPWWC6NuqhV174lfYvAm9fUaWeiefLdux9/YI3/nLugEn9L8fcSi0XmpKi/r5u0nmpw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@webassemblyjs/ast@1.14.1':
|
||||
|
@ -1043,8 +1043,8 @@ packages:
|
|||
ee-first@1.1.1:
|
||||
resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==}
|
||||
|
||||
electron-to-chromium@1.5.143:
|
||||
resolution: {integrity: sha512-QqklJMOFBMqe46k8iIOwA9l2hz57V2OKMmP5eSWcUvwx+mASAsbU+wkF1pHjn9ZVSBPrsYWr4/W/95y5SwYg2g==}
|
||||
electron-to-chromium@1.5.144:
|
||||
resolution: {integrity: sha512-eJIaMRKeAzxfBSxtjYnoIAw/tdD6VIH6tHBZepZnAbE3Gyqqs5mGN87DvcldPUbVkIljTK8pY0CMcUljP64lfQ==}
|
||||
|
||||
emoji-regex@8.0.0:
|
||||
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
|
||||
|
@ -3013,14 +3013,14 @@ snapshots:
|
|||
dependencies:
|
||||
'@types/node': 22.15.3
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.31.0(@typescript-eslint/parser@8.31.0(eslint@9.25.1)(typescript@5.8.3))(eslint@9.25.1)(typescript@5.8.3)':
|
||||
'@typescript-eslint/eslint-plugin@8.31.1(@typescript-eslint/parser@8.31.1(eslint@9.25.1)(typescript@5.8.3))(eslint@9.25.1)(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@eslint-community/regexpp': 4.12.1
|
||||
'@typescript-eslint/parser': 8.31.0(eslint@9.25.1)(typescript@5.8.3)
|
||||
'@typescript-eslint/scope-manager': 8.31.0
|
||||
'@typescript-eslint/type-utils': 8.31.0(eslint@9.25.1)(typescript@5.8.3)
|
||||
'@typescript-eslint/utils': 8.31.0(eslint@9.25.1)(typescript@5.8.3)
|
||||
'@typescript-eslint/visitor-keys': 8.31.0
|
||||
'@typescript-eslint/parser': 8.31.1(eslint@9.25.1)(typescript@5.8.3)
|
||||
'@typescript-eslint/scope-manager': 8.31.1
|
||||
'@typescript-eslint/type-utils': 8.31.1(eslint@9.25.1)(typescript@5.8.3)
|
||||
'@typescript-eslint/utils': 8.31.1(eslint@9.25.1)(typescript@5.8.3)
|
||||
'@typescript-eslint/visitor-keys': 8.31.1
|
||||
eslint: 9.25.1
|
||||
graphemer: 1.4.0
|
||||
ignore: 5.3.2
|
||||
|
@ -3030,27 +3030,27 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/parser@8.31.0(eslint@9.25.1)(typescript@5.8.3)':
|
||||
'@typescript-eslint/parser@8.31.1(eslint@9.25.1)(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@typescript-eslint/scope-manager': 8.31.0
|
||||
'@typescript-eslint/types': 8.31.0
|
||||
'@typescript-eslint/typescript-estree': 8.31.0(typescript@5.8.3)
|
||||
'@typescript-eslint/visitor-keys': 8.31.0
|
||||
'@typescript-eslint/scope-manager': 8.31.1
|
||||
'@typescript-eslint/types': 8.31.1
|
||||
'@typescript-eslint/typescript-estree': 8.31.1(typescript@5.8.3)
|
||||
'@typescript-eslint/visitor-keys': 8.31.1
|
||||
debug: 4.4.0
|
||||
eslint: 9.25.1
|
||||
typescript: 5.8.3
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/scope-manager@8.31.0':
|
||||
'@typescript-eslint/scope-manager@8.31.1':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.31.0
|
||||
'@typescript-eslint/visitor-keys': 8.31.0
|
||||
'@typescript-eslint/types': 8.31.1
|
||||
'@typescript-eslint/visitor-keys': 8.31.1
|
||||
|
||||
'@typescript-eslint/type-utils@8.31.0(eslint@9.25.1)(typescript@5.8.3)':
|
||||
'@typescript-eslint/type-utils@8.31.1(eslint@9.25.1)(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@typescript-eslint/typescript-estree': 8.31.0(typescript@5.8.3)
|
||||
'@typescript-eslint/utils': 8.31.0(eslint@9.25.1)(typescript@5.8.3)
|
||||
'@typescript-eslint/typescript-estree': 8.31.1(typescript@5.8.3)
|
||||
'@typescript-eslint/utils': 8.31.1(eslint@9.25.1)(typescript@5.8.3)
|
||||
debug: 4.4.0
|
||||
eslint: 9.25.1
|
||||
ts-api-utils: 2.1.0(typescript@5.8.3)
|
||||
|
@ -3058,12 +3058,12 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/types@8.31.0': {}
|
||||
'@typescript-eslint/types@8.31.1': {}
|
||||
|
||||
'@typescript-eslint/typescript-estree@8.31.0(typescript@5.8.3)':
|
||||
'@typescript-eslint/typescript-estree@8.31.1(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.31.0
|
||||
'@typescript-eslint/visitor-keys': 8.31.0
|
||||
'@typescript-eslint/types': 8.31.1
|
||||
'@typescript-eslint/visitor-keys': 8.31.1
|
||||
debug: 4.4.0
|
||||
fast-glob: 3.3.3
|
||||
is-glob: 4.0.3
|
||||
|
@ -3074,20 +3074,20 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/utils@8.31.0(eslint@9.25.1)(typescript@5.8.3)':
|
||||
'@typescript-eslint/utils@8.31.1(eslint@9.25.1)(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.6.1(eslint@9.25.1)
|
||||
'@typescript-eslint/scope-manager': 8.31.0
|
||||
'@typescript-eslint/types': 8.31.0
|
||||
'@typescript-eslint/typescript-estree': 8.31.0(typescript@5.8.3)
|
||||
'@typescript-eslint/scope-manager': 8.31.1
|
||||
'@typescript-eslint/types': 8.31.1
|
||||
'@typescript-eslint/typescript-estree': 8.31.1(typescript@5.8.3)
|
||||
eslint: 9.25.1
|
||||
typescript: 5.8.3
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/visitor-keys@8.31.0':
|
||||
'@typescript-eslint/visitor-keys@8.31.1':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.31.0
|
||||
'@typescript-eslint/types': 8.31.1
|
||||
eslint-visitor-keys: 4.2.0
|
||||
|
||||
'@webassemblyjs/ast@1.14.1':
|
||||
|
@ -3318,7 +3318,7 @@ snapshots:
|
|||
browserslist@4.24.4:
|
||||
dependencies:
|
||||
caniuse-lite: 1.0.30001715
|
||||
electron-to-chromium: 1.5.143
|
||||
electron-to-chromium: 1.5.144
|
||||
node-releases: 2.0.19
|
||||
update-browserslist-db: 1.1.3(browserslist@4.24.4)
|
||||
|
||||
|
@ -3536,7 +3536,7 @@ snapshots:
|
|||
|
||||
ee-first@1.1.1: {}
|
||||
|
||||
electron-to-chromium@1.5.143: {}
|
||||
electron-to-chromium@1.5.144: {}
|
||||
|
||||
emoji-regex@8.0.0: {}
|
||||
|
||||
|
|
|
@ -73,11 +73,24 @@ export default function (client: ScramjetClient, self: Self) {
|
|||
|
||||
args[0] = new Proxy(realEvent, {
|
||||
get(target, prop, reciever) {
|
||||
const value = Reflect.get(target, prop);
|
||||
if (prop in handler) {
|
||||
return handler[prop].call(target);
|
||||
}
|
||||
|
||||
return Reflect.get(target, prop, reciever);
|
||||
if (prop in Event.prototype && typeof value === "function") {
|
||||
return new Proxy(value, {
|
||||
apply(target, that, args) {
|
||||
if (that === reciever) {
|
||||
return Reflect.apply(target, realEvent, args);
|
||||
}
|
||||
|
||||
return Reflect.apply(target, that, args);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return value;
|
||||
},
|
||||
getOwnPropertyDescriptor: getOwnPropertyDescriptorHandler,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue