tc39/test262

top-level using

Geschlossen

#5.073 geöffnet am 19.06.2026

 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (469 Forks)batch import
coveragehelp wanted

Repository-Metriken

Stars
 (2.073 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 12T 12h) (9 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide