Skip to content

A way to require different symbol fields than ProtocolName.* #48

@LeaVerou

Description

@LeaVerou

E.g. suppose we wanted to implement iterables as a protocol. How do you make Symbol.iterator a required field? Same for all other known symbols.

I wonder if we need a ComputedPropertyKey syntax as well, which would not be rewritten to symbols.

protocol Iterable {
  [Symbol.iterator];

  forEach() { /* ... */ }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    resolvedConsensus reached, question answered, etc.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions