Impl Setlike and Maplike (#30237)

* MallocSizeOf for Index{Set, Map}

* like as iterable in WebIDL

* Codegen magic for like interfaces

* TestBinding for like

* Test for Setlike and Maplike test bindings

* Some fixes

* Switch to any.js

* nit

* Keep order
This commit is contained in:
Samson 2023-09-06 15:08:45 +02:00 committed by GitHub
parent 3df284cf54
commit e0a6281e73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 1088 additions and 4 deletions

View file

@ -516,7 +516,11 @@ def getUnwrappedType(type):
def iteratorNativeType(descriptor, infer=False):
assert descriptor.interface.isIterable()
iterableDecl = descriptor.interface.maplikeOrSetlikeOrIterable
assert iterableDecl.isPairIterator()
return "IterableIterator%s" % ("" if infer else '<%s>' % descriptor.interface.identifier.name)
assert (iterableDecl.isIterable() and iterableDecl.isPairIterator()) \
or iterableDecl.isSetlike() or iterableDecl.isMaplike()
res = "IterableIterator%s" % ("" if infer else '<%s>' % descriptor.interface.identifier.name)
# todo: this hack is telling us that something is still wrong in codegen
if iterableDecl.isSetlike() or iterableDecl.isMaplike():
res = f"crate::dom::bindings::iterable::{res}"
return res