tc39/test262

top-level using

クローズ

#5,073 opened on 2026/06/19

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (469 件のフォーク)batch import
coveragehelp wanted

Repository metrics

Stars
 (2,073 個のスター)
PR merge metrics
 (平均マージ 12d 12h) (30d で 9 merged PRs)

説明

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");

コントリビューターガイド