3 ms·
I think the issue they were getting at is code like this: function doSomething(doSomethingElse) { internalState.setUp(); doSomethingElse();
by poink 5y ago
I think the issue they were getting at is code like this:
function doSomething(doSomethingElse) {
internalState.setUp();
doSomethingElse();
internalState.tearDown();
}
Right now, you can safely assume this whole thing will execute to completion without anything else happening in the interim, so a lot of existing JS makes that assumption. If `doSomethingElse` can yield while other code executes the assumption becomes invalid.