mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-20 06:07:30 +09:00
Issue #1322 - Part 4: Fix WebIDL.py parser for line endings and wrong
IDL name
This commit is contained in:
parent
15672c6231
commit
d3e44892bf
1 changed files with 40 additions and 40 deletions
|
|
@ -2850,45 +2850,45 @@ class IDLWrapperType(IDLType):
|
||||||
return set([self.inner])
|
return set([self.inner])
|
||||||
return set()
|
return set()
|
||||||
|
|
||||||
|
|
||||||
class IDLPromiseType(IDLParametrizedType):
|
class IDLPromiseType(IDLParameterizedType):
|
||||||
def __init__(self, location, innerType):
|
def __init__(self, location, innerType):
|
||||||
IDLParametrizedType.__init__(self, location, "Promise", innerType)
|
IDLParameterizedType.__init__(self, location, "Promise", innerType)
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
return (isinstance(other, IDLPromiseType) and
|
return (isinstance(other, IDLPromiseType) and
|
||||||
self.promiseInnerType() == other.promiseInnerType())
|
self.promiseInnerType() == other.promiseInnerType())
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.inner.__str__() + "Promise"
|
return self.inner.__str__() + "Promise"
|
||||||
|
|
||||||
def isPromise(self):
|
def isPromise(self):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def promiseInnerType(self):
|
def promiseInnerType(self):
|
||||||
return self.inner
|
return self.inner
|
||||||
|
|
||||||
def tag(self):
|
def tag(self):
|
||||||
return IDLType.Tags.promise
|
return IDLType.Tags.promise
|
||||||
|
|
||||||
def complete(self, scope):
|
def complete(self, scope):
|
||||||
self.inner = self.promiseInnerType().complete(scope)
|
self.inner = self.promiseInnerType().complete(scope)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def unroll(self):
|
def unroll(self):
|
||||||
# We do not unroll our inner. Just stop at ourselves. That
|
# We do not unroll our inner. Just stop at ourselves. That
|
||||||
# lets us add headers for both ourselves and our inner as
|
# lets us add headers for both ourselves and our inner as
|
||||||
# needed.
|
# needed.
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def isDistinguishableFrom(self, other):
|
def isDistinguishableFrom(self, other):
|
||||||
# Promises are not distinguishable from anything.
|
# Promises are not distinguishable from anything.
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def isExposedInAllOf(self, exposureSet):
|
def isExposedInAllOf(self, exposureSet):
|
||||||
# Check the internal type
|
# Check the internal type
|
||||||
return self.promiseInnerType().unroll().isExposedInAllOf(exposureSet)
|
return self.promiseInnerType().unroll().isExposedInAllOf(exposureSet)
|
||||||
|
|
||||||
|
|
||||||
class IDLBuiltinType(IDLType):
|
class IDLBuiltinType(IDLType):
|
||||||
|
|
||||||
|
|
@ -6439,7 +6439,7 @@ class Parser(Tokenizer):
|
||||||
|
|
||||||
if p[1].name == "Promise":
|
if p[1].name == "Promise":
|
||||||
raise WebIDLError("Promise used without saying what it's "
|
raise WebIDLError("Promise used without saying what it's "
|
||||||
"parametrized over",
|
"parameterized over",
|
||||||
[self.getLocation(p, 1)])
|
[self.getLocation(p, 1)])
|
||||||
|
|
||||||
type = None
|
type = None
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue