Skip to content

Commit

Permalink
fix(server): descriptor issue with .fetch and dummy ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Jul 25, 2024
1 parent 82255d8 commit 91df5d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wise-ads-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@whatwg-node/server': patch
---

Fix descriptor issue when .fetch is used with dummy context
5 changes: 4 additions & 1 deletion packages/server/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,10 @@ export function completeAssign(...args: any[]) {
// modified Object.keys to Object.getOwnPropertyNames
// because Object.keys only returns enumerable properties
const descriptors: any = Object.getOwnPropertyNames(source).reduce((descriptors: any, key) => {
descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
const descriptor = Object.getOwnPropertyDescriptor(source, key);
if (descriptor) {
descriptors[key] = Object.getOwnPropertyDescriptor(source, key);
}
return descriptors;
}, {});

Expand Down

0 comments on commit 91df5d2

Please sign in to comment.