mirror of
https://github.com/servo/servo
synced 2026-04-26 09:35:26 +02:00
Import sequence inner types if it appears in dictionary members
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
import os
|
||||
|
||||
from WebIDL import IDLExternalInterface, IDLWrapperType, WebIDLError
|
||||
from WebIDL import IDLExternalInterface, IDLSequenceType, IDLWrapperType, WebIDLError
|
||||
|
||||
|
||||
class Configuration:
|
||||
@@ -457,7 +457,7 @@ def getTypesFromDictionary(dictionary):
|
||||
types = []
|
||||
curDict = dictionary
|
||||
while curDict:
|
||||
types.extend([m.type for m in curDict.members])
|
||||
types.extend([getUnwrappedType(m.type) for m in curDict.members])
|
||||
curDict = curDict.parent
|
||||
return types
|
||||
|
||||
@@ -473,6 +473,12 @@ def getTypesFromCallback(callback):
|
||||
return types
|
||||
|
||||
|
||||
def getUnwrappedType(type):
|
||||
while isinstance(type, IDLSequenceType):
|
||||
type = type.inner
|
||||
return type
|
||||
|
||||
|
||||
def iteratorNativeType(descriptor, infer=False):
|
||||
assert descriptor.interface.isIterable()
|
||||
iterableDecl = descriptor.interface.maplikeOrSetlikeOrIterable
|
||||
|
||||
Reference in New Issue
Block a user