Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

await using normative changes #58624

Merged
merged 2 commits into from
May 29, 2024
Merged

await using normative changes #58624

merged 2 commits into from
May 29, 2024

Conversation

rbuckton
Copy link
Member

@rbuckton rbuckton commented May 22, 2024

This aligns TypeScript with a number of normative updates to the Explicit Resource Management proposal, per #58622:

  • [Symbol.dispose]() methods are wrapped in a closure when used in an await using declaration.
  • Promise-like values returned by [Symbol.dispose]() are ignored in an await using declaration.
  • Synchronous exceptions thrown by [Symbol.dispose]() in an await using declaration are turned into rejections.

See microsoft/tslib#258 for the companion PR for tslib.

Fixes #58077
Fixes #58622

@rbuckton rbuckton changed the title 'await using' normative changes await using normative changes May 24, 2024
@rbuckton rbuckton merged commit 2a9e4b8 into main May 29, 2024
28 checks passed
@rbuckton rbuckton deleted the fix58077 branch May 29, 2024 21:34
@rbuckton
Copy link
Member Author

@sandersn if you can take a look at microsoft/tslib#258 too, I'd appreciate it.

skeate added a commit to skeate/TypeScript that referenced this pull request Jun 1, 2024
* upstream/main: (37 commits)
  Added NoTruncation flag to completions (microsoft#58719)
  Clone node to remove location even when it has been modified if needed (microsoft#58706)
  Properly account for `this` argument in intersection apparent type caching (microsoft#58677)
  Fix: Include Values of Script Extensions for Unicode Property Value Expressions in Regular Expressions (microsoft#58615)
  In `reScanSlashToken` use `charCodeChecked` not `codePointChecked` (microsoft#58727)
  Shorten error spans for errors reported on constructor declarations (microsoft#58061)
  Mark file as skips typechecking if it contains ts-nocheck (microsoft#58593)
  Fixed an issue with broken `await using` declarations in `for of` loops (microsoft#56466)
  Do not expand type references in keyof and index access (microsoft#58715)
  Improve the performance of isolatedDeclarations quickfix  (microsoft#58722)
  Unwrap `NoInfer` types when narrowing (microsoft#58292)
  Recover from type reuse errors by falling back to inferred type printing (microsoft#58720)
  Fixing self import (microsoft#58718)
  Enable JS emit for noCheck and noCheck for transpileModule (microsoft#58364)
  Revert PR 55371 (microsoft#58702)
  Update dependencies (microsoft#58639)
  Fix baselines after PR 58621 (microsoft#58705)
  Do not infer `yield*` type from contextual `TReturn` (microsoft#58621)
  `await using` normative changes (microsoft#58624)
  Handling statements from a known source file (microsoft#58679)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
3 participants