summaryrefslogtreecommitdiff
path: root/op_crates/fetch/11_streams.js
diff options
context:
space:
mode:
Diffstat (limited to 'op_crates/fetch/11_streams.js')
-rw-r--r--op_crates/fetch/11_streams.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/op_crates/fetch/11_streams.js b/op_crates/fetch/11_streams.js
index 549bc9922..c3fa6cb6f 100644
--- a/op_crates/fetch/11_streams.js
+++ b/op_crates/fetch/11_streams.js
@@ -81,13 +81,14 @@
if (value instanceof Map) {
const clonedMap = new Map();
objectCloneMemo.set(value, clonedMap);
- value.forEach((v, k) => clonedMap.set(k, cloneValue(v)));
+ value.forEach((v, k) => {
+ clonedMap.set(cloneValue(k), cloneValue(v));
+ });
return clonedMap;
}
if (value instanceof Set) {
- const clonedSet = new Map();
+ const clonedSet = new Set([...value].map(cloneValue));
objectCloneMemo.set(value, clonedSet);
- value.forEach((v, k) => clonedSet.set(k, cloneValue(v)));
return clonedSet;
}
@@ -97,6 +98,7 @@
for (const key of sourceKeys) {
clonedObj[key] = cloneValue(value[key]);
}
+ Reflect.setPrototypeOf(clonedObj, Reflect.getPrototypeOf(value));
return clonedObj;
}
case "symbol":