Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/57425 |
e60eacb to
2aa75eb
Compare
| if (isAwait) { | ||
| var inner = dispose; | ||
| } |
There was a problem hiding this comment.
var inner = isAwait && dispose;
Will this be smaller?
There was a problem hiding this comment.
- // size: 972, gzip size: 498
+ // size: 971, gzip size: 500It will save one byte for plaintext but the compressed size is increased by 2.
|
Could you include tc39/proposal-explicit-resource-management#219 too? |
898b27d to
631f722
Compare
|
It seems that the CI failure on Node.js 8 is due to a platform-specific bug. I will skip the new test for Node < 10. |
nicolo-ribaudo
left a comment
There was a problem hiding this comment.
I think this looks correct to me, I'll make sure that we are running test262 tests though
| if (resource.a) { | ||
| return Promise.resolve(disposalResult).then(next, err); | ||
| if (!resource.a && state === StateFlag.NEEDS_AWAIT) { | ||
| state = StateFlag.NONE; |
There was a problem hiding this comment.
Note: If tc39/proposal-explicit-resource-management#219 (comment) gets consensus, we can simply change this line to state = StateFlag.HAS_AWAITED. Before that happens we implement the 2024-06 version as-is.
7a63e72 to
b9602b1
Compare
This PR implements the following normative changes:
Symbol.disposemethod in an await using declaration is ignoredSymbol.disposemethod in an await using declaration are turned into promise rejections.Both of them are supported via a wrapper around the
Symbol.disposemethod.This PR also fixes a compliance issue: When searching a dispose method, Babel will not fallback to
Symbol.disposeifSymbol.asyncDisposemethod isnullordocument.all.