From 17d23ee84839c6f3b4c8c3f33eee6b04bd5ff448 Mon Sep 17 00:00:00 2001 From: JustOff Date: Wed, 13 Mar 2019 19:01:09 +0200 Subject: [PATCH] Add some tests for distinguishability of unions --- dom/bindings/parser/WebIDL.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dom/bindings/parser/WebIDL.py b/dom/bindings/parser/WebIDL.py index 7d06dbcecf..8c71333fa8 100644 --- a/dom/bindings/parser/WebIDL.py +++ b/dom/bindings/parser/WebIDL.py @@ -2321,8 +2321,10 @@ class IDLNullableType(IDLParameterizedType): return self def isDistinguishableFrom(self, other): - if (other.nullable() or (other.isUnion() and other.hasNullableType) or - other.isDictionary()): + if (other.nullable() or + other.isDictionary() or + (other.isUnion() and + (other.hasNullableType or other.hasDictionaryType()))): # Can't tell which type null should become return False return self.inner.isDistinguishableFrom(other)