Repro: Run this on chrome's new tab (or some other page that it works on)
async function getResponseSize(url) {
function doThat() {
debugger;
const value = result.value;
total += value.length;
console.log('Received chunk', value);
}
async function getStuff() {
while ((result = await reader.read()) && !result.done) {
doThat();
}
}
const response = await fetch(url);
const reader = response.body.getReader();
let result;
let total = 0;
total = getStuff()
return total;
}
getResponseSize('/');
Functions get duplicated in the callstack.
Not too bad, but kinda annoying.
|
Deleted:
Screen Shot 2016-10-07 at 12.37.57 PM.png
37.6 KB
|
|
Screen Shot 2016-10-07 at 12.37.57 PM.png
37.6 KB
View
Download
|
|
Comment 1 by kozyatinskiy@chromium.org
, Oct 20 201665.8 KB
65.8 KB View Download