Loading dom/bindings/Codegen.py +24 −16 Original line number Diff line number Diff line Loading @@ -2240,7 +2240,7 @@ class CGClassConstructor(CGAbstractStaticMethod): ) name = self._ctor.identifier.name nativeName = MakeNativeName(self.descriptor.binaryNameFor(name)) nativeName = MakeNativeName(self.descriptor.binaryNameFor(name, True)) callGenerator = CGMethodCall( nativeName, True, self.descriptor, self._ctor, isConstructor=True ) Loading Loading @@ -10602,7 +10602,7 @@ class CGSpecializedMethod(CGAbstractStaticMethod): if method.underlyingAttr: return CGSpecializedGetter.makeNativeName(descriptor, method.underlyingAttr) name = method.identifier.name return MakeNativeName(descriptor.binaryNameFor(name)) return MakeNativeName(descriptor.binaryNameFor(name, method.isStatic())) class CGMethodPromiseWrapper(CGAbstractStaticMethod): Loading Loading @@ -10699,7 +10699,7 @@ class CGLegacyCallHook(CGAbstractBindingMethod): def generate_code(self): name = self._legacycaller.identifier.name nativeName = MakeNativeName(self.descriptor.binaryNameFor(name)) nativeName = MakeNativeName(self.descriptor.binaryNameFor(name, False)) return CGMethodCall(nativeName, False, self.descriptor, self._legacycaller) def error_reporting_label(self): Loading Loading @@ -11172,7 +11172,7 @@ class CGSpecializedGetter(CGAbstractStaticMethod): @staticmethod def makeNativeName(descriptor, attr): name = attr.identifier.name nativeName = MakeNativeName(descriptor.binaryNameFor(name)) nativeName = MakeNativeName(descriptor.binaryNameFor(name, attr.isStatic())) _, resultOutParam, _, _, _ = getRetvalDeclarationForType(attr.type, descriptor) extendedAttrs = descriptor.getExtendedAttributes(attr, getter=True) canFail = "needsErrorResult" in extendedAttrs or "canOOM" in extendedAttrs Loading Loading @@ -11336,7 +11336,7 @@ class CGSpecializedSetter(CGAbstractStaticMethod): @staticmethod def makeNativeName(descriptor, attr): name = attr.identifier.name return "Set" + MakeNativeName(descriptor.binaryNameFor(name)) return "Set" + MakeNativeName(descriptor.binaryNameFor(name, attr.isStatic())) class CGStaticSetter(CGAbstractStaticBindingMethod): Loading Loading @@ -14003,7 +14003,7 @@ class CGProxySpecialOperation(CGPerSignatureCall): self.checkFound = checkFound self.foundVar = foundVar or "found" nativeName = MakeNativeName(descriptor.binaryNameFor(operation)) nativeName = MakeNativeName(descriptor.binaryNameFor(operation, False)) operation = descriptor.operations[operation] assert len(operation.signatures()) == 1 signature = operation.signatures()[0] Loading Loading @@ -19968,11 +19968,15 @@ class CGJSImplMethod(CGJSImplMember): # We're always fallible def callbackGetterName(attr, descriptor): return "Get" + MakeNativeName(descriptor.binaryNameFor(attr.identifier.name)) return "Get" + MakeNativeName( descriptor.binaryNameFor(attr.identifier.name, attr.isStatic()) ) def callbackSetterName(attr, descriptor): return "Set" + MakeNativeName(descriptor.binaryNameFor(attr.identifier.name)) return "Set" + MakeNativeName( descriptor.binaryNameFor(attr.identifier.name, attr.isStatic()) ) class CGJSImplGetter(CGJSImplMember): Loading Loading @@ -20678,7 +20682,7 @@ class CGCallbackInterface(CGCallback): needInitId = True idlist = [ descriptor.binaryNameFor(m.identifier.name) descriptor.binaryNameFor(m.identifier.name, m.isStatic()) for m in iface.members if m.isAttr() or m.isMethod() ] Loading Loading @@ -21230,7 +21234,7 @@ class CallbackOperationBase(CallbackMethod): spiderMonkeyInterfacesAreStructs=False, ): self.singleOperation = singleOperation self.methodName = descriptor.binaryNameFor(jsName) self.methodName = descriptor.binaryNameFor(jsName, False) CallbackMethod.__init__( self, signature, Loading Loading @@ -21304,7 +21308,7 @@ class CallbackOperation(CallbackOperationBase): self, signature, jsName, MakeNativeName(descriptor.binaryNameFor(jsName)), MakeNativeName(descriptor.binaryNameFor(jsName, False)), descriptor, descriptor.interface.isSingleOperationInterface(), rethrowContentException=descriptor.interface.isJSImplemented(), Loading Loading @@ -21371,7 +21375,7 @@ class CallbackGetter(CallbackAccessor): """, atomCacheName=self.descriptorProvider.interface.identifier.name + "Atoms", attrAtomName=CGDictionary.makeIdName( self.descriptorProvider.binaryNameFor(self.attrName) self.descriptorProvider.binaryNameFor(self.attrName, False) ), errorReturn=self.getDefaultRetval(), ) Loading Loading @@ -21410,7 +21414,7 @@ class CallbackSetter(CallbackAccessor): """, atomCacheName=self.descriptorProvider.interface.identifier.name + "Atoms", attrAtomName=CGDictionary.makeIdName( self.descriptorProvider.binaryNameFor(self.attrName) self.descriptorProvider.binaryNameFor(self.attrName, False) ), errorReturn=self.getDefaultRetval(), ) Loading Loading @@ -22917,7 +22921,7 @@ class GlobalGenRoots: structs = [] def memberToAtomCacheMember(binaryNameFor, m): binaryMemberName = binaryNameFor(m.identifier.name) binaryMemberName = binaryNameFor(m) return ClassMember( CGDictionary.makeIdName(binaryMemberName), "PinnedStringId", Loading @@ -22941,7 +22945,9 @@ class GlobalGenRoots: if len(dict.members) == 0: continue structs.append(buildAtomCacheStructure(dict, lambda x: x, dict.members)) structs.append( buildAtomCacheStructure(dict, lambda m: m.identifier.name, dict.members) ) for d in config.getDescriptors(isJSImplemented=True) + config.getDescriptors( isCallback=True Loading @@ -22960,7 +22966,9 @@ class GlobalGenRoots: structs.append( buildAtomCacheStructure( d.interface, lambda x: d.binaryNameFor(x), members d.interface, lambda m: d.binaryNameFor(m.identifier.name, m.isStatic()), members, ) ) dom/bindings/Configuration.py +7 −5 Original line number Diff line number Diff line Loading @@ -701,7 +701,9 @@ class Descriptor(DescriptorProvider): if binaryName: assert isinstance(binaryName, list) assert len(binaryName) == 1 self._binaryNames.setdefault(member.identifier.name, binaryName[0]) self._binaryNames.setdefault( (member.identifier.name, member.isStatic()), binaryName[0] ) for member in self.interface.members: if not member.isAttr() and not member.isMethod(): Loading @@ -713,8 +715,8 @@ class Descriptor(DescriptorProvider): maybeAddBinaryName(ctor) # Some default binary names for cases when nothing else got set. self._binaryNames.setdefault("__legacycaller", "LegacyCall") self._binaryNames.setdefault("__stringifier", "Stringify") self._binaryNames.setdefault(("__legacycaller", False), "LegacyCall") self._binaryNames.setdefault(("__stringifier", False), "Stringify") # Build the prototype chain. self.prototypeChain = [] Loading @@ -733,8 +735,8 @@ class Descriptor(DescriptorProvider): self.hasOrdinaryObjectPrototype = desc.get("hasOrdinaryObjectPrototype", False) def binaryNameFor(self, name): return self._binaryNames.get(name, name) def binaryNameFor(self, name, isStatic): return self._binaryNames.get((name, isStatic), name) @property def prototypeNameChain(self): Loading dom/bindings/parser/WebIDL.py +5 −1 Original line number Diff line number Diff line Loading @@ -1234,7 +1234,11 @@ class IDLInterfaceOrNamespace(IDLInterfaceOrInterfaceMixinOrNamespace): for mixin in sorted(self.includedMixins, key=lambda x: x.identifier.name): for mixinMember in mixin.members: for member in self.members: if mixinMember.identifier.name == member.identifier.name: if mixinMember.identifier.name == member.identifier.name and ( not mixinMember.isMethod() or not member.isMethod() or mixinMember.isStatic() == member.isStatic() ): raise WebIDLError( "Multiple definitions of %s on %s coming from 'includes' statements" % (member.identifier.name, self), Loading Loading
dom/bindings/Codegen.py +24 −16 Original line number Diff line number Diff line Loading @@ -2240,7 +2240,7 @@ class CGClassConstructor(CGAbstractStaticMethod): ) name = self._ctor.identifier.name nativeName = MakeNativeName(self.descriptor.binaryNameFor(name)) nativeName = MakeNativeName(self.descriptor.binaryNameFor(name, True)) callGenerator = CGMethodCall( nativeName, True, self.descriptor, self._ctor, isConstructor=True ) Loading Loading @@ -10602,7 +10602,7 @@ class CGSpecializedMethod(CGAbstractStaticMethod): if method.underlyingAttr: return CGSpecializedGetter.makeNativeName(descriptor, method.underlyingAttr) name = method.identifier.name return MakeNativeName(descriptor.binaryNameFor(name)) return MakeNativeName(descriptor.binaryNameFor(name, method.isStatic())) class CGMethodPromiseWrapper(CGAbstractStaticMethod): Loading Loading @@ -10699,7 +10699,7 @@ class CGLegacyCallHook(CGAbstractBindingMethod): def generate_code(self): name = self._legacycaller.identifier.name nativeName = MakeNativeName(self.descriptor.binaryNameFor(name)) nativeName = MakeNativeName(self.descriptor.binaryNameFor(name, False)) return CGMethodCall(nativeName, False, self.descriptor, self._legacycaller) def error_reporting_label(self): Loading Loading @@ -11172,7 +11172,7 @@ class CGSpecializedGetter(CGAbstractStaticMethod): @staticmethod def makeNativeName(descriptor, attr): name = attr.identifier.name nativeName = MakeNativeName(descriptor.binaryNameFor(name)) nativeName = MakeNativeName(descriptor.binaryNameFor(name, attr.isStatic())) _, resultOutParam, _, _, _ = getRetvalDeclarationForType(attr.type, descriptor) extendedAttrs = descriptor.getExtendedAttributes(attr, getter=True) canFail = "needsErrorResult" in extendedAttrs or "canOOM" in extendedAttrs Loading Loading @@ -11336,7 +11336,7 @@ class CGSpecializedSetter(CGAbstractStaticMethod): @staticmethod def makeNativeName(descriptor, attr): name = attr.identifier.name return "Set" + MakeNativeName(descriptor.binaryNameFor(name)) return "Set" + MakeNativeName(descriptor.binaryNameFor(name, attr.isStatic())) class CGStaticSetter(CGAbstractStaticBindingMethod): Loading Loading @@ -14003,7 +14003,7 @@ class CGProxySpecialOperation(CGPerSignatureCall): self.checkFound = checkFound self.foundVar = foundVar or "found" nativeName = MakeNativeName(descriptor.binaryNameFor(operation)) nativeName = MakeNativeName(descriptor.binaryNameFor(operation, False)) operation = descriptor.operations[operation] assert len(operation.signatures()) == 1 signature = operation.signatures()[0] Loading Loading @@ -19968,11 +19968,15 @@ class CGJSImplMethod(CGJSImplMember): # We're always fallible def callbackGetterName(attr, descriptor): return "Get" + MakeNativeName(descriptor.binaryNameFor(attr.identifier.name)) return "Get" + MakeNativeName( descriptor.binaryNameFor(attr.identifier.name, attr.isStatic()) ) def callbackSetterName(attr, descriptor): return "Set" + MakeNativeName(descriptor.binaryNameFor(attr.identifier.name)) return "Set" + MakeNativeName( descriptor.binaryNameFor(attr.identifier.name, attr.isStatic()) ) class CGJSImplGetter(CGJSImplMember): Loading Loading @@ -20678,7 +20682,7 @@ class CGCallbackInterface(CGCallback): needInitId = True idlist = [ descriptor.binaryNameFor(m.identifier.name) descriptor.binaryNameFor(m.identifier.name, m.isStatic()) for m in iface.members if m.isAttr() or m.isMethod() ] Loading Loading @@ -21230,7 +21234,7 @@ class CallbackOperationBase(CallbackMethod): spiderMonkeyInterfacesAreStructs=False, ): self.singleOperation = singleOperation self.methodName = descriptor.binaryNameFor(jsName) self.methodName = descriptor.binaryNameFor(jsName, False) CallbackMethod.__init__( self, signature, Loading Loading @@ -21304,7 +21308,7 @@ class CallbackOperation(CallbackOperationBase): self, signature, jsName, MakeNativeName(descriptor.binaryNameFor(jsName)), MakeNativeName(descriptor.binaryNameFor(jsName, False)), descriptor, descriptor.interface.isSingleOperationInterface(), rethrowContentException=descriptor.interface.isJSImplemented(), Loading Loading @@ -21371,7 +21375,7 @@ class CallbackGetter(CallbackAccessor): """, atomCacheName=self.descriptorProvider.interface.identifier.name + "Atoms", attrAtomName=CGDictionary.makeIdName( self.descriptorProvider.binaryNameFor(self.attrName) self.descriptorProvider.binaryNameFor(self.attrName, False) ), errorReturn=self.getDefaultRetval(), ) Loading Loading @@ -21410,7 +21414,7 @@ class CallbackSetter(CallbackAccessor): """, atomCacheName=self.descriptorProvider.interface.identifier.name + "Atoms", attrAtomName=CGDictionary.makeIdName( self.descriptorProvider.binaryNameFor(self.attrName) self.descriptorProvider.binaryNameFor(self.attrName, False) ), errorReturn=self.getDefaultRetval(), ) Loading Loading @@ -22917,7 +22921,7 @@ class GlobalGenRoots: structs = [] def memberToAtomCacheMember(binaryNameFor, m): binaryMemberName = binaryNameFor(m.identifier.name) binaryMemberName = binaryNameFor(m) return ClassMember( CGDictionary.makeIdName(binaryMemberName), "PinnedStringId", Loading @@ -22941,7 +22945,9 @@ class GlobalGenRoots: if len(dict.members) == 0: continue structs.append(buildAtomCacheStructure(dict, lambda x: x, dict.members)) structs.append( buildAtomCacheStructure(dict, lambda m: m.identifier.name, dict.members) ) for d in config.getDescriptors(isJSImplemented=True) + config.getDescriptors( isCallback=True Loading @@ -22960,7 +22966,9 @@ class GlobalGenRoots: structs.append( buildAtomCacheStructure( d.interface, lambda x: d.binaryNameFor(x), members d.interface, lambda m: d.binaryNameFor(m.identifier.name, m.isStatic()), members, ) )
dom/bindings/Configuration.py +7 −5 Original line number Diff line number Diff line Loading @@ -701,7 +701,9 @@ class Descriptor(DescriptorProvider): if binaryName: assert isinstance(binaryName, list) assert len(binaryName) == 1 self._binaryNames.setdefault(member.identifier.name, binaryName[0]) self._binaryNames.setdefault( (member.identifier.name, member.isStatic()), binaryName[0] ) for member in self.interface.members: if not member.isAttr() and not member.isMethod(): Loading @@ -713,8 +715,8 @@ class Descriptor(DescriptorProvider): maybeAddBinaryName(ctor) # Some default binary names for cases when nothing else got set. self._binaryNames.setdefault("__legacycaller", "LegacyCall") self._binaryNames.setdefault("__stringifier", "Stringify") self._binaryNames.setdefault(("__legacycaller", False), "LegacyCall") self._binaryNames.setdefault(("__stringifier", False), "Stringify") # Build the prototype chain. self.prototypeChain = [] Loading @@ -733,8 +735,8 @@ class Descriptor(DescriptorProvider): self.hasOrdinaryObjectPrototype = desc.get("hasOrdinaryObjectPrototype", False) def binaryNameFor(self, name): return self._binaryNames.get(name, name) def binaryNameFor(self, name, isStatic): return self._binaryNames.get((name, isStatic), name) @property def prototypeNameChain(self): Loading
dom/bindings/parser/WebIDL.py +5 −1 Original line number Diff line number Diff line Loading @@ -1234,7 +1234,11 @@ class IDLInterfaceOrNamespace(IDLInterfaceOrInterfaceMixinOrNamespace): for mixin in sorted(self.includedMixins, key=lambda x: x.identifier.name): for mixinMember in mixin.members: for member in self.members: if mixinMember.identifier.name == member.identifier.name: if mixinMember.identifier.name == member.identifier.name and ( not mixinMember.isMethod() or not member.isMethod() or mixinMember.isStatic() == member.isStatic() ): raise WebIDLError( "Multiple definitions of %s on %s coming from 'includes' statements" % (member.identifier.name, self), Loading