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
{{ message }}
Repository navigation
Gap: await using (Symbol.asyncDispose / ES2024 explicit resource management) #154
test-files/test_gap_async_advanced.ts (line 180-201) exercises await using with [Symbol.asyncDispose]() — the ES2024 explicit-resource-management proposal. Perry silently accepts the syntax but never runs the dispose hook.
Repro
asyncfunctiontest(){constdisposed: string[]=[];classAsyncResource{name: string;constructor(name: string){this.name=name;}async[Symbol.asyncDispose](): Promise<void>{awaitnewPromise<void>((r)=>setTimeout(r,1));disposed.push(this.name);}}{await using r1=newAsyncResource("res1");await using r2=newAsyncResource("res2");}console.log(disposed.join(","));// expected "res2,res1"}
Actual vs Expected
Perry: "" (dispose never ran)
Node: "res2,res1" (disposed in reverse declaration order)
Scope
Parse / lower await using and using binding forms
Attach an implicit dispose queue per block scope; register each binding's [Symbol.asyncDispose]() on creation
On block exit (success OR exception), await each registered disposer in reverse order, then re-throw any exception with SuppressedError chaining
Synchronous using dispatches to [Symbol.dispose](); async dispatches to [Symbol.asyncDispose]()
Impact
One of six currently-failing gap tests (post v0.5.173, baseline 22/28 passing). Only this feature blocks test_gap_async_advanced from passing — everything else in that file works.
Activity
chore(release): fold v0.5.167-v0.5.176 work into single commit (v0.5.…
fix(hir): PerryTS#154 using/await using dispose hooks (v0.5.317)
fix(hir): #212 class methods inside fn can capture enclosing-fn local…
fix: closes #302 (Map/Set on class field for-of) + #154 (using/dispos…
fix: closes #304 + #305 — array.length=N truncate + class-field local…
fix(hir): closes #310 — traverse `export * as X from ...` namespace r…
fix(transform): closes #531 — add `Expr::ArrayPush`/`ArrayPushSpread`…