mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 00:08:39 +09:00
Issue #1810 - Allow superfluous [LenientFloat] extended attributes.
This changes the way the extended attribute [LenientFloat] behaves, so that overloading functions can match extended attributes while not having restricted float type arguments themselves.
This commit is contained in:
parent
71bd54891a
commit
18f039543a
1 changed files with 10 additions and 4 deletions
|
|
@ -4888,6 +4888,16 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
|||
raise WebIDLError("StaticClassOverride can be applied to static"
|
||||
" methods on JS-implemented classes only.",
|
||||
[self.location])
|
||||
if self.getExtendedAttribute("LenientFloat"):
|
||||
assert len(self.signatures()) >= 1
|
||||
found = False
|
||||
for sig in self.signatures():
|
||||
if any(arg.type.includesRestrictedFloat() for arg in sig[1]):
|
||||
found = True
|
||||
if not found:
|
||||
raise WebIDLError("[LenientFloat] used on an operation with no "
|
||||
"restricted float type arguments",
|
||||
[self.location])
|
||||
|
||||
def overloadsForArgCount(self, argc):
|
||||
return [overload for overload in self._overloads if
|
||||
|
|
@ -4966,10 +4976,6 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
|||
if not sig[0].isVoid():
|
||||
raise WebIDLError("[LenientFloat] used on a non-void method",
|
||||
[attr.location, self.location])
|
||||
if not any(arg.type.includesRestrictedFloat() for arg in sig[1]):
|
||||
raise WebIDLError("[LenientFloat] used on an operation with no "
|
||||
"restricted float type arguments",
|
||||
[attr.location, self.location])
|
||||
elif identifier == "Exposed":
|
||||
convertExposedAttrToGlobalNameSet(attr, self._exposureGlobalNames)
|
||||
elif (identifier == "CrossOriginCallable" or
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue