-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Closed
Copy link
Labels
upstreamChanges in upstream are required to solve these issuesChanges in upstream are required to solve these issuesv8Bugs in upstream v8Bugs in upstream v8
Description
Version: Deno 2.2.11
Despite --js-explicit-resource-management v8 flag enabled by default since 2.2.10, the (now obsolete) explicit_resource_management SWC transpilation transformer was not disabled for TypeScript sources. Consequently, TypeScript scripts run with deno still do not benefit from this natively.
Here's a reproducer:
// test.ts
try {
using _foo = {
[Symbol.dispose]() {
throw new Error("foo");
},
};
throw new Error("bar");
} catch (e) {
console.log(e);
}deno run test.tsOutputs:
SuppressedError: An error was suppressed during disposal.
at fail (file:///test.ts:41:34)
at next (file:///test.ts:57:11)
at _ts_dispose_resources (file:///test.ts:63:12)
at _ts_dispose_resources (file:///test.ts:64:5)
at file:///test.ts:8:19
The stack trace clearly shows transpiled code with _ts_dispose_resources, which comes from SWC helpers, so the disposal execution actually doesn't leverage v8 natively at all.
On the other hand, if we rename test.ts to test.js, no transpilation occurs, and it works natively as expected:
deno run test.jsOutputs:
SuppressedError: An error was suppressed during disposal
at file:///test.js:8:3
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
upstreamChanges in upstream are required to solve these issuesChanges in upstream are required to solve these issuesv8Bugs in upstream v8Bugs in upstream v8