Bug 1792655 - Make maplike<> and setlike<> generated methods enumerable. r=edgar

Differential Revision: https://phabricator.services.mozilla.com/D162860
This commit is contained in:
Peter Van der Beken 2022-11-24 14:35:35 +00:00
Родитель 12d1e77ad4
Коммит f650e7dd34
5 изменённых файлов: 10 добавлений и 33 удалений

Просмотреть файл

@ -4670,12 +4670,6 @@ class IDLMaplikeOrSetlikeOrIterableBase(IDLInterfaceMember):
method.addExtendedAttributes(
[IDLExtendedAttribute(self.location, ("Alias", "@@asyncIterator"))]
)
# Methods generated for iterables should be enumerable, but the ones for
# maplike/setlike should not be.
if not self.isIterable() and not self.isAsyncIterable():
method.addExtendedAttributes(
[IDLExtendedAttribute(self.location, ("NonEnumerable",))]
)
members.append(method)
def resolve(self, parentScope):
@ -4932,20 +4926,17 @@ class IDLMaplikeOrSetlike(IDLMaplikeOrSetlikeOrIterableBase):
specification during parsing.
"""
# Both maplike and setlike have a size attribute
sizeAttr = IDLAttribute(
self.location,
IDLUnresolvedIdentifier(
BuiltinLocation("<auto-generated-identifier>"), "size"
),
BuiltinTypes[IDLBuiltinType.Types.unsigned_long],
True,
maplikeOrSetlike=self,
members.append(
IDLAttribute(
self.location,
IDLUnresolvedIdentifier(
BuiltinLocation("<auto-generated-identifier>"), "size"
),
BuiltinTypes[IDLBuiltinType.Types.unsigned_long],
True,
maplikeOrSetlike=self,
)
)
# This should be non-enumerable.
sizeAttr.addExtendedAttributes(
[IDLExtendedAttribute(self.location, ("NonEnumerable",))]
)
members.append(sizeAttr)
self.reserved_ro_names = ["size"]
self.disallowedMemberNames.append("size")

Просмотреть файл

@ -60,9 +60,6 @@
[Stringification of performance.interactionCounts]
expected: FAIL
[EventCounts interface: maplike<DOMString, unsigned long long>]
expected: FAIL
[idlharness.any.sharedworker.html]
expected:

Просмотреть файл

@ -172,9 +172,6 @@
[AudioWorklet interface: context.audioWorklet must inherit property "port" with the proper type]
expected: FAIL
[AudioParamMap interface: maplike<DOMString, AudioParam>]
expected: FAIL
[AudioContext interface: attribute sinkId]
expected: FAIL

Просмотреть файл

@ -327,8 +327,3 @@
expected:
if os == "android": FAIL
[MIDIInputMap interface: maplike<DOMString, MIDIInput>]
expected: FAIL
[MIDIOutputMap interface: maplike<DOMString, MIDIOutput>]
expected: FAIL

Просмотреть файл

@ -484,9 +484,6 @@
[RTCIceCandidate interface: new RTCIceCandidate({ sdpMid: 1 }) must inherit property "relayProtocol" with the proper type]
expected: FAIL
[RTCStatsReport interface: maplike<DOMString, object>]
expected: FAIL
[RTCIceCandidate interface: attribute url]
expected: FAIL