Skip to content

"converting to an ECMAScript value" needs to take a realm, at least sometimes #371

Open

Description

@domenic

E.g. if you convert a sequence<DOMString> to an array, you need to specify the realm/global in which the conversion happens.

Related: w3ctag/promises-guide#52 (comment)

Activity

  1. bzbarsky commented on Jun 21, 2017

    @bzbarsky
    Contributor

    So for the uses in the IDL spec itself, there is always a current Realm, I believe.

    But I agree, for uses from other specs something needs to happen.

  2. TimothyGu commented on Dec 3, 2017

    @TimothyGu
    Member

    Is there a way to find out which specs call the "convert to an ECMAScript value" algorithm, other than Web IDL itself?

  3. bzbarsky commented on Dec 4, 2017

    @bzbarsky
    Contributor

    Not trivially.

    You could look for specs that have object or any (or sequences thereof) return values. And specs with Promise<sequence<something>> return values. And so on....

    It's not even trivial to tell from implementations, I suspect. In Gecko promises will automatically pick a global based on various criteria when you resolve them with something...

    That said, a non-exhaustive list (just Promise<sequence<*>> bits, not all of which actually invoke the WebIDL algorithm) is:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions