Skip to content

Support for asynchronous Garbage Collection in host-defined $262.gc() #5029

@jcscottiii

Description

@jcscottiii

During the integration of Test262 into Web Platform Tests (WPT) (PR), we noted that $262.gc() is expected by Test262 tests to be synchronous. However, in many modern web browsers, garbage collection is inherently asynchronous or non-blocking for performance reasons, and WPT's TestUtils.gc() is often asynchronous.

Test262 tests that rely on $262.gc() usually assume it is synchronous and that garbage collection has occurred before the next line of code executes.

Would Test262 consider allowing $262.gc() to return a Promise or provide some other completion signal for hosts where GC is asynchronous?

Or is there a recommended pattern for handling async GC in Test262 tests?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions