summaryrefslogtreecommitdiff
path: root/dom/bindings/parser/WebIDL.py
diff options
context:
space:
mode:
Diffstat (limited to 'dom/bindings/parser/WebIDL.py')
-rw-r--r--dom/bindings/parser/WebIDL.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/dom/bindings/parser/WebIDL.py b/dom/bindings/parser/WebIDL.py
index ce8862c02b..59db43f6bd 100644
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -248,8 +248,14 @@ class IDLScope(IDLObject):
return self.QName()
def QName(self):
- if self._name:
- return self._name.QName() + "::"
+ # It's possible for us to be called before __init__ has been called, for
+ # the IDLObjectWithScope case. In that case, self._name won't be set yet.
+ if hasattr(self, "_name"):
+ name = self._name
+ else:
+ name = None
+ if name:
+ return name.QName() + "::"
return "::"
def ensureUnique(self, identifier, object):