Skip to content

Commit

Permalink
chore: performance
Browse files Browse the repository at this point in the history
  • Loading branch information
kuitos committed Nov 15, 2023
1 parent ce09e4f commit d434d34
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/sandbox/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,15 @@ export function rebindTarget2Fn(target: any, fn: any): any {
'toString',
);

Object.defineProperty(boundValue, 'toString', {
...originToStringDescriptor,
...(originToStringDescriptor?.get ? null : { value: () => fn.toString() }),
});
Object.defineProperty(
boundValue,
'toString',
Object.assign(
{},
originToStringDescriptor,
originToStringDescriptor?.get ? null : { value: () => fn.toString() },
),
);
}
}

Expand Down

0 comments on commit d434d34

Please sign in to comment.