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

feat: explicit resource management in TypeScript #20506

Merged
merged 2 commits into from
Sep 14, 2023

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Sep 14, 2023

This adds support for using and await using declarations in TypeScript only. We need to wait for v8 to support it for this to work in JS.

Follow-up to #20425

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dsherret dsherret enabled auto-merge (squash) September 14, 2023 17:46
@dsherret dsherret merged commit 6dc8682 into denoland:main Sep 14, 2023
13 checks passed
@dsherret dsherret deleted the feat_explicit_resource_management branch September 14, 2023 18:21
@petamoriken
Copy link
Contributor

Since the TypeScript transpile does not provide SuppressedError class for globalThis, it may be better to add polyfill until V8 has an implementation.

typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
    var e = new Error(message);
    return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
}

https://www.typescriptlang.org/play?ts=5.2.2#code/GYewTgBAFArgzgSwHYHMIA8ImBBAXAUzAENCAlAuEGMAY0qgEpGIBvAKAggHpuJ4CGdgF8gA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants