-
Notifications
You must be signed in to change notification settings - Fork 198
Closed
Description
As discussed in whatwg/url#204, there is some confusion about the distinguishability between string types and sequences. Although currently, the spec maintains that they are distinguishable, @domenic and @annevk have express doubts over that.
What I have found is that:
- ES string primitives are NOT valid sequences, and are therefore distinguishable. Even though string primitives have a
@@iterator, they fail thetypeof === 'object'check in conversion to a sequence. - ES string wrapper objects ARE valid sequences. They pass the aforementioned test, and they likewise have a valid iterator interface.
This is exemplified in Firefox, which implements iterable-to-sequence conversion:
>> new Headers([ 'ab' ]).get('a')
** "TypeError: Element of member of HeadersOrByteStringSequenceSequenceOrByteStringMozMap can't be converted to a sequence."
>> new Headers([ new String('ab') ]).get('a')
<- "b"How can we resolve this situation?
Metadata
Metadata
Assignees
Labels
No labels