It is difficult to explain the phenomenon, but at any rate, after this commit, using a function named using behaves strangely. Specifically, assertRejects cannot catch errors thrown without the internal async function, or it cannot wait for the internal async function to complete (I have tried everything, but the behavior does not seem consistent).
The contents of the using function are not related to the phenomenon (because the behavior is fixed if I renamed using to usingA or whatever), but they are as follows.
I'm thinking that perhaps the await using part of the behavior has changed since TypeScirpt 5.2 due to the increase in the using keyword, but I honestly don't know.
It is difficult to explain the phenomenon, but at any rate, after this commit, using a function named
using
behaves strangely. Specifically, assertRejects cannot catch errors thrown without the internal async function, or it cannot wait for the internal async function to complete (I have tried everything, but the behavior does not seem consistent).The contents of the using function are not related to the phenomenon (because the behavior is fixed if I renamed
using
tousingA
or whatever), but they are as follows.If this function is used in the form of "await using" as shown below, the behavior will suddenly become strange.
You can find all codes in the following library (it's small enough to check I think)
https://github.com/lambdalisue/deno-disposable
I'm thinking that perhaps the
await using
part of the behavior has changed since TypeScirpt 5.2 due to the increase in theusing
keyword, but I honestly don't know.