Skip to content

Commit 9a0c2fc

Browse files
committed
[core] fix: already proxied functions would go into client.natives if Proxy was called twice on the same path
1 parent 1b8e5ad commit 9a0c2fc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/client/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,10 @@ export class ScramjetClient {
432432
const target = split.reduce((a, b) => a?.[b], this.global);
433433
if (!target) return;
434434

435-
const original = Reflect.get(target, prop);
436-
this.natives.store[name] = original;
435+
if (!(name in this.natives.store)) {
436+
const original = Reflect.get(target, prop);
437+
this.natives.store[name] = original;
438+
}
437439

438440
this.RawProxy(target, prop, handler);
439441
}

0 commit comments

Comments
 (0)