diff options
author | Samson <16504129+sagudev@users.noreply.github.com> | 2023-09-06 15:08:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-06 13:08:45 +0000 |
commit | e0a6281e7375468f367aadf398d5a836512d9df6 (patch) | |
tree | d29cc82409d68f4b053de615d66c17ac779addd5 /components/script/dom/bindings/codegen/Configuration.py | |
parent | 3df284cf54d9d99daf32794a030efa6358f5cf39 (diff) | |
download | servo-e0a6281e7375468f367aadf398d5a836512d9df6.tar.gz servo-e0a6281e7375468f367aadf398d5a836512d9df6.zip |
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
Diffstat (limited to 'components/script/dom/bindings/codegen/Configuration.py')
-rw-r--r-- | components/script/dom/bindings/codegen/Configuration.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/components/script/dom/bindings/codegen/Configuration.py b/components/script/dom/bindings/codegen/Configuration.py index bd455f5288e..aa32093772f 100644 --- a/components/script/dom/bindings/codegen/Configuration.py +++ b/components/script/dom/bindings/codegen/Configuration.py @@ -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 |