GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — `await using` normative updates by JLHwung · Pull Request #16537 · babel/babel Conversation
|
| Q | A |
|---|---|
| Fixed Issues? | Implements tc39/proposal-explicit-resource-management#218, tc39/proposal-explicit-resource-management#219, closes #16409 |
| Patch: Bug Fix? | |
| Major: Breaking Change? | |
| Minor: New Feature? | |
| Tests Added + Pass? | Yes |
| Documentation PR Link | |
| Any Dependency Changes? | |
| License | MIT |
This PR implements the following normative changes:
Symbol.dispose method in an await using declaration is ignoredSymbol.dispose method in an await using declaration are turned into promise rejections.Both of them are supported via a wrapper around the Symbol.dispose method.
This PR also fixes a compliance issue: When searching a dispose method, Babel will not fallback to Symbol.dispose if Symbol.asyncDispose method is null or document.all.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/57425 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
e60eacb to
2aa75eb
Compare
| if (isAwait) { | ||
| var inner = dispose; | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
var inner = isAwait && dispose;
Will this be smaller?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
- // size: 972, gzip size: 498 + // size: 971, gzip size: 500
It will save one byte for plaintext but the compressed size is increased by 2.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Could you include tc39/proposal-explicit-resource-management#219 too? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think this looks correct to me, I'll make sure that we are running test262 tests though
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (resource.a) { | ||
| return Promise.resolve(disposalResult).then(next, err); | ||
| if (!resource.a && state === StateFlag.NEEDS_AWAIT) { | ||
| state = StateFlag.NONE; |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
7a63e72 to
b9602b1
Compare
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.