Skip to content

dart:html should add type descriptions for JS foreign functions in promiseToFuture calls #43225

@srujzs

Description

@srujzs

In many cases, promiseToFuture calls to get promises on a native type look like the following:

promiseToFuture<RtcSessionDescription>(JS("", "#.createOffer(#)", this, options_dict))

This is an issue since RtcSessionDescription is not necessarily live at the time and will fail to type-check. In order to circumvent this, and make the type live, there needs to exist a type description in the JS foreign function that signals to the compiler that this type may be live after this call, e.g.

JS("creates:<type>;", ...)

For more context, see #42796 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.library-htmlweb-librariesIssues impacting dart:html, etc., libraries

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions