mirror of
https://github.com/servo/servo.git
synced 2025-07-25 08:10:21 +01:00
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:
parent
3df284cf54
commit
e0a6281e73
19 changed files with 1088 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue