Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/56669 |
| } | ||
| stack.push({ v: value, d: dispose, a: isAwait }); | ||
| } else if (isAwait) { | ||
| stack.push({ a: isAwait }); |
There was a problem hiding this comment.
Can you explicitly set d to undefined, given that we read it later?
There was a problem hiding this comment.
Or set it to false to save a few bytes?
There was a problem hiding this comment.
We could probably use value here.
There was a problem hiding this comment.
Anything works for me as long as it's something :)
6ef1fe9 to
6600aec
Compare
| stack.push({ v: value, d: dispose, a: isAwait }); | ||
| } else if (isAwait) { | ||
| // provide the nullish `value` as `d` for minification gain | ||
| stack.push({ d: value, a: isAwait }); |
There was a problem hiding this comment.
Aside: currently await using x = document.all will go to this branch, we probably should reject it. I will check the spec and open a new PR to fix that.
|
There will be some changes related to this in the proposal: tc39/proposal-explicit-resource-management#219 We will have a conclusion at the end of the week. |
In the REPL example,
It should log
"f body", "body", "y", but currently it logs"f body", "y", "body".Per spec 7.5.7 Dispose, if
hintisasync-dispose, the result should be awaited, even if it is nullish. Therefore the disposing of the next resourceyshould followlog.push("body").