tc39/test262

top-level using

已關閉

#5,073 建立於 2026年6月19日

 (1 則留言) (0 個反應) (0 位負責人)JavaScript (469 個分叉)batch import
coveragehelp wanted

倉庫指標

星標
 (2,073 顆星)
PR 合併指標
 (平均合併 12天 12小時) (30 天內合併 9 個 PR)

描述

Our XS engine has supported Explicit Resource Management for years behind a flag. We are preparing to enable that by default, now that the proposal has achieved Stage 4. 🎉 Despite passing 100% of Explicit Resource Management tests in test262, we found that XS was not invoking [Symbol.dispose] when exiting the top-level of a module (see example below). Perhaps it is worth extending test262 coverage to ensure this is handled correctly and consistently.

class Foo {
	close() {
		trace(`Dispose!\n`);
	}
	toString() {
		return "I'm foo";
	}
	static {
		this.prototype[Symbol.dispose] = this.prototype.close;
	}
}

using x = new Foo
trace(x, "\n");

貢獻者指南