From c7ae364a887e9fb77196596d6e4345b455ab209f Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Thu, 19 Dec 2019 03:26:59 +0100 Subject: Issue #1322 - Part 4: Fix WebIDL.py parser for line endings and wrong IDL name --- dom/bindings/parser/WebIDL.py | 80 +++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/dom/bindings/parser/WebIDL.py b/dom/bindings/parser/WebIDL.py index fafb3c9b6..4f602365b 100644 --- a/dom/bindings/parser/WebIDL.py +++ b/dom/bindings/parser/WebIDL.py @@ -2850,45 +2850,45 @@ class IDLWrapperType(IDLType): return set([self.inner]) return set() - -class IDLPromiseType(IDLParametrizedType): - def __init__(self, location, innerType): - IDLParametrizedType.__init__(self, location, "Promise", innerType) - - def __eq__(self, other): - return (isinstance(other, IDLPromiseType) and - self.promiseInnerType() == other.promiseInnerType()) - - def __str__(self): - return self.inner.__str__() + "Promise" - - def isPromise(self): - return True - - def promiseInnerType(self): - return self.inner - - def tag(self): - return IDLType.Tags.promise - - def complete(self, scope): - self.inner = self.promiseInnerType().complete(scope) - return self - - def unroll(self): - # We do not unroll our inner. Just stop at ourselves. That - # lets us add headers for both ourselves and our inner as - # needed. - return self - - def isDistinguishableFrom(self, other): - # Promises are not distinguishable from anything. - return False - - def isExposedInAllOf(self, exposureSet): - # Check the internal type - return self.promiseInnerType().unroll().isExposedInAllOf(exposureSet) - + +class IDLPromiseType(IDLParameterizedType): + def __init__(self, location, innerType): + IDLParameterizedType.__init__(self, location, "Promise", innerType) + + def __eq__(self, other): + return (isinstance(other, IDLPromiseType) and + self.promiseInnerType() == other.promiseInnerType()) + + def __str__(self): + return self.inner.__str__() + "Promise" + + def isPromise(self): + return True + + def promiseInnerType(self): + return self.inner + + def tag(self): + return IDLType.Tags.promise + + def complete(self, scope): + self.inner = self.promiseInnerType().complete(scope) + return self + + def unroll(self): + # We do not unroll our inner. Just stop at ourselves. That + # lets us add headers for both ourselves and our inner as + # needed. + return self + + def isDistinguishableFrom(self, other): + # Promises are not distinguishable from anything. + return False + + def isExposedInAllOf(self, exposureSet): + # Check the internal type + return self.promiseInnerType().unroll().isExposedInAllOf(exposureSet) + class IDLBuiltinType(IDLType): @@ -6439,7 +6439,7 @@ class Parser(Tokenizer): if p[1].name == "Promise": raise WebIDLError("Promise used without saying what it's " - "parametrized over", + "parameterized over", [self.getLocation(p, 1)]) type = None -- cgit v1.2.3