We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
using
The Symbol.dispose function is not invoked when using the using keyword.
Symbol.dispose
The output includes
finally{ _ts_dispose_resources(env); }
However, this function is defined as
function _ts_dispose_resources(SuppressedError1) { return function(env) { // ... }; }
So calling _ts_dispose_resources(env); does not actually invoke the dispose logic.
_ts_dispose_resources(env);
The function does seem to be invoked here, so something else must be going wrong:
swc/crates/swc_ecma_transforms_base/src/helpers/_ts_dispose_resources.js
Line 32 in 8f45eaf
using x = { [Symbol.dispose]() { console.log("disposed") } };
{ "jsc": { "parser": { "syntax": "ecmascript", "jsx": false, "explicitResourceManagement":true }, "target": "es2022", "loose": false, "minify": { "compress": false, "mangle": false } }, "module": { "type": "commonjs" }, "minify": false, "isModule": true }
https://play.swc.rs/?version=1.7.39&code=H4sIAAAAAAAAAystzsxLV6hQsFWo5lJQiA6uzE3Kz9FLySwuyC9OjdXQBAsrKCTn5xXn56Tq5eSnayhBZVOUNIFytVy11gBoxdWzRQAAAA%3D%3D&config=H4sIAAAAAAAAA1VPOw6DMAzdOQXyzFAx9g4svYGVGhSUn2IjgRB3bxIgbbe8f7w3bQszK3i2e3omEDAyxYoTw5sTXBMDpCyyijoIdLc6c5ZGNEwd0BqMVlpexH6JigZ0OJElJ%2FCUuFAJHWcWBONEUnq5f%2FT91QnGe6baeXJWOz1uv79S3oZIzP%2FGbEU3mZo%2FF5trFax%2FL0W8rpUtZJTbrHczw9d5L9Z20Dzc8XLM8QEIU%2BriPgEAAA%3D%3D
No response
console.log("disposed") should run
console.log("disposed")
No log message
1.7.39
See also #9576
The text was updated successfully, but these errors were encountered:
kdy1
No branches or pull requests
Describe the bug
The
Symbol.dispose
function is not invoked when using theusing
keyword.The output includes
However, this function is defined as
So calling
_ts_dispose_resources(env);
does not actually invoke the dispose logic.The function does seem to be invoked here, so something else must be going wrong:
swc/crates/swc_ecma_transforms_base/src/helpers/_ts_dispose_resources.js
Line 32 in 8f45eaf
Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.7.39&code=H4sIAAAAAAAAAystzsxLV6hQsFWo5lJQiA6uzE3Kz9FLySwuyC9OjdXQBAsrKCTn5xXn56Tq5eSnayhBZVOUNIFytVy11gBoxdWzRQAAAA%3D%3D&config=H4sIAAAAAAAAA1VPOw6DMAzdOQXyzFAx9g4svYGVGhSUn2IjgRB3bxIgbbe8f7w3bQszK3i2e3omEDAyxYoTw5sTXBMDpCyyijoIdLc6c5ZGNEwd0BqMVlpexH6JigZ0OJElJ%2FCUuFAJHWcWBONEUnq5f%2FT91QnGe6baeXJWOz1uv79S3oZIzP%2FGbEU3mZo%2FF5trFax%2FL0W8rpUtZJTbrHczw9d5L9Z20Dzc8XLM8QEIU%2BriPgEAAA%3D%3D
SWC Info output
No response
Expected behavior
console.log("disposed")
should runActual behavior
No log message
Version
1.7.39
Additional context
See also #9576
The text was updated successfully, but these errors were encountered: