1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00

fix: stream strategy size should be plain function

This commit is contained in:
Luca Casonato 2021-07-03 21:35:59 +02:00 committed by Luca Casonato
parent 14104c4e5b
commit 7ef0f43d87

View file

@ -3018,9 +3018,8 @@
if (byteSizeFunctionWeakMap.has(globalObject)) { if (byteSizeFunctionWeakMap.has(globalObject)) {
return; return;
} }
byteSizeFunctionWeakMap.set(globalObject, function size(chunk) { const size = (chunk) => chunk.byteLength;
return chunk.byteLength; byteSizeFunctionWeakMap.set(globalObject, size);
});
} }
class CountQueuingStrategy { class CountQueuingStrategy {
@ -3071,9 +3070,8 @@
if (countSizeFunctionWeakMap.has(globalObject)) { if (countSizeFunctionWeakMap.has(globalObject)) {
return; return;
} }
countSizeFunctionWeakMap.set(globalObject, function size() { const size = () => 1;
return 1; countSizeFunctionWeakMap.set(globalObject, size);
});
} }
/** @template R */ /** @template R */