mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 827486, part 1: add JSImplementation extended attribute. r=bz
This commit is contained in:
parent
65d4ad2e50
commit
76ed2433f1
@ -376,8 +376,11 @@ class Descriptor(DescriptorProvider):
|
||||
else:
|
||||
add('all', [config], attribute)
|
||||
|
||||
for attribute in ['implicitJSContext', 'resultNotAddRefed']:
|
||||
addExtendedAttribute(attribute, desc.get(attribute, {}))
|
||||
if self.interface.isJSImplemented():
|
||||
addExtendedAttribute('implicitJSContext', ['constructor'])
|
||||
else:
|
||||
for attribute in ['implicitJSContext', 'resultNotAddRefed']:
|
||||
addExtendedAttribute(attribute, desc.get(attribute, {}))
|
||||
|
||||
self.binaryNames = desc.get('binaryNames', {})
|
||||
if '__legacycaller' not in self.binaryNames:
|
||||
@ -420,9 +423,9 @@ class Descriptor(DescriptorProvider):
|
||||
attrs.append("infallible")
|
||||
|
||||
name = member.identifier.name
|
||||
throws = self.interface.isJSImplemented() or member.getExtendedAttribute("Throws")
|
||||
if member.isMethod():
|
||||
attrs = self.extendedAttributes['all'].get(name, [])
|
||||
throws = member.getExtendedAttribute("Throws")
|
||||
maybeAppendInfallibleToAttrs(attrs, throws)
|
||||
return attrs
|
||||
|
||||
@ -430,7 +433,6 @@ class Descriptor(DescriptorProvider):
|
||||
assert bool(getter) != bool(setter)
|
||||
key = 'getterOnly' if getter else 'setterOnly'
|
||||
attrs = self.extendedAttributes['all'].get(name, []) + self.extendedAttributes[key].get(name, [])
|
||||
throws = member.getExtendedAttribute("Throws")
|
||||
if throws is None:
|
||||
throwsAttr = "GetterThrows" if getter else "SetterThrows"
|
||||
throws = member.getExtendedAttribute(throwsAttr)
|
||||
|
@ -475,6 +475,12 @@ class IDLExternalInterface(IDLObjectWithIdentifier):
|
||||
def resolve(self, parentScope):
|
||||
pass
|
||||
|
||||
def getJSImplementation(self):
|
||||
return None
|
||||
|
||||
def isJSImplemented(self):
|
||||
return False
|
||||
|
||||
def _getDependentObjects(self):
|
||||
return set()
|
||||
|
||||
@ -956,6 +962,17 @@ class IDLInterface(IDLObjectWithScope):
|
||||
# Put the new members at the beginning
|
||||
self.members = members + self.members
|
||||
|
||||
def getJSImplementation(self):
|
||||
classId = self.getExtendedAttribute("JSImplementation")
|
||||
if not classId:
|
||||
return classId
|
||||
assert isinstance(classId, list)
|
||||
assert len(classId) == 1
|
||||
return classId[0]
|
||||
|
||||
def isJSImplemented(self):
|
||||
return bool(self.getJSImplementation())
|
||||
|
||||
def _getDependentObjects(self):
|
||||
deps = set(self.members)
|
||||
deps.union(self.implementedInterfaces)
|
||||
|
Loading…
Reference in New Issue
Block a user