Skip to content

Implement WebIDL sequence arguments correctly #9290

Closed

Description

@Ms2ger

We do something silly right now with arrays rather than with Symbol.iterator, as the spec says.

See servo/rust-mozjs#226, #544, #9056.

Activity

  1. added
    A-content/bindings
    I-wrong
    on Jan 13, 2016
  2. frewsxcv commented on Jan 13, 2016

    @frewsxcv
    Contributor
  3. nox commented on Sep 30, 2017

    @nox
    Contributor

    @emilio @frewsxcv Was this fixed in the end?

  4. saschanaz commented on Oct 16, 2019

    @saschanaz
    Contributor

    I don't believe so: https://github.com/servo/rust-mozjs/blob/3de4ff3d52361a47a17e3b4fcb02c779b99d93d4/src/conversions.rs#L611-L625 vs. https://heycam.github.io/webidl/#es-sequence

    That code seems to internally use Symbole.iterator and also match the corresponding Gecko code.

    Edit: And it in fact supports Symbol.iterator.

    const params = new URLSearchParams({
      *[Symbol.iterator]() {
        yield {
          *[Symbol.iterator]() {
            yield "ABC";
            yield "BCD";
          }
        };
      }
    }).toString();
    // returns "ABC=BCD" as expected
  5. jdm commented on Oct 16, 2019

    @jdm
    Member

    I guess we're done here!

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

    A-content/bindingsI-wrong

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions