You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Investigation denoland/deno#25757 lead to realizing that the transpilation of the using keyword in SWC doesn't seem to call the dispose hooks when inside a loop. Running the reproduction snippet should log that all dispose methods are called, but they're never called with the transpiled variant.
Input code
classDisposable{disposed=false;[Symbol.dispose](){this.disposed=true}}constdisposables=[newDisposable()]for(using_ofdisposables){/* ... */}if(disposables[0].disposed){console.log("✅ dispose ok")}else{console.error("💥 failed to dispose")}classAsyncDisposable{disposed=false;[Symbol.asyncDispose](){this.disposed=true}}constasyncDisposables=[newAsyncDisposable()]for(awaitusing_ofasyncDisposables){/* ... */}if(asyncDisposables[0].disposed){console.log("✅ async dispose ok")}else{
console.error("💥 failed to async dispose")}
Describe the bug
Investigation denoland/deno#25757 lead to realizing that the transpilation of the
using
keyword in SWC doesn't seem to call the dispose hooks when inside a loop. Running the reproduction snippet should log that all dispose methods are called, but they're never called with the transpiled variant.Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.7.26&code=H4sIAAAAAAAAA52QPW4CMRCFe59itJWXwtAjiki5AeVqFZnFS6w4O5HHCCG0JRegRkqVi%2BUEOQKzDj%2FeFUWIO%2FvNm%2Bf3VU4TwbOlDyS9cAZ2AmAZr2YJM6i1IzMV%2FFjMt%2B8LdOosljKPs90Jr5ZUYgp%2BbVhqRStEhQ2F88YugFgvGrNJMmVeClGjB7km26zgBbBOHRw0HoFSCkZj3mhrkIlaTMpr9u%2BXukh0Rjlcyez7uL%2F0AXzLctGC4Uq9QeM9epn9fB6%2BuLB1XCLgxdVZuEbk9ETbpnoElr4ZHiSm%2B1FXbIMv3NjpjbYBEoLDDXcwDkf%2BwDJa%2Fkm0541cT19Nfi1%2FAgAA&config=H4sIAAAAAAAAA1WQPQ7CMAyFd05ReWZAHRi4AxMnsIJbBTU%2Fsh2JCvXuJOn%2FEiXfe8%2BO%2Fbs0DXzEwKP55Wt%2BRGQh3t6ZyOgVv5mAjpHEsI0K11VVKZJyokqmWQBF7klLiKS9te0SgCEEoYw7HIQW5qy33XhsaYKLTCJnY7Gi74ctf%2B7I6KUL7I6FmNDoAWRkXQysr5DYlELgo3vMtutu4uTVuqpj0uBQrYFFni7rWVuDC%2B9U%2F7RssGxpHvwOu2mdcZsHrDzXZF3f9Ae8XWptjQEAAA%3D%3D
SWC Info output
No response
Expected behavior
The reproduction snippet should log out that the dispose hooks are called.
Actual behavior
No response
Version
1.7.26
Additional context
No response
The text was updated successfully, but these errors were encountered: