Skip to content

Shouldn't await using early throw for non-disposable objects? #208

@PaperStrike

Description

@PaperStrike

In #180, the [Symbol.dispose] method is wrapped when hint is 'async-dispose', even if the method is undefined. This bypasses the outer check in CreateDisposableResource, where it would typically trigger a TypeError for undefined method. I find this behavior unexpected, as the original issue #179 did not intend to alter the behavior of await using / AsyncDisposableStack.use in a way that it would no longer throw errors for non-disposable values before usage but only when disposing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    normativeIndicates a normative change to the specification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions