diff options
author | Luca Casonato <hello@lcas.dev> | 2021-07-03 21:35:59 +0200 |
---|---|---|
committer | Luca Casonato <lucacasonato@yahoo.com> | 2021-07-03 22:20:28 +0200 |
commit | 7ef0f43d87e3e45e8084bb7ae0dee2053968c010 (patch) | |
tree | 066ddfce1cf3e86f9d31ae0a4b618ee3e11392aa /extensions/web/06_streams.js | |
parent | 14104c4e5be0ef3d68b4459a727ea1b0b7aa83e1 (diff) |
fix: stream strategy size should be plain function
Diffstat (limited to 'extensions/web/06_streams.js')
-rw-r--r-- | extensions/web/06_streams.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/extensions/web/06_streams.js b/extensions/web/06_streams.js index 79403442a..48585e8be 100644 --- a/extensions/web/06_streams.js +++ b/extensions/web/06_streams.js @@ -3018,9 +3018,8 @@ if (byteSizeFunctionWeakMap.has(globalObject)) { return; } - byteSizeFunctionWeakMap.set(globalObject, function size(chunk) { - return chunk.byteLength; - }); + const size = (chunk) => chunk.byteLength; + byteSizeFunctionWeakMap.set(globalObject, size); } class CountQueuingStrategy { @@ -3071,9 +3070,8 @@ if (countSizeFunctionWeakMap.has(globalObject)) { return; } - countSizeFunctionWeakMap.set(globalObject, function size() { - return 1; - }); + const size = () => 1; + countSizeFunctionWeakMap.set(globalObject, size); } /** @template R */ |