diff --git a/xpcom/idl-parser/xpidl/header.py b/xpcom/idl-parser/xpidl/header.py index 6009db0e1ab4..18a75b1e5c4e 100644 --- a/xpcom/idl-parser/xpidl/header.py +++ b/xpcom/idl-parser/xpidl/header.py @@ -414,7 +414,7 @@ def write_interface(iface, fd): realtype = a.realtype.nativeType('in') tmpl = attr_builtin_infallible_tmpl - if a.realtype.kind != 'builtin': + if a.realtype.kind != 'builtin' and a.realtype.kind != 'cenum': assert realtype.endswith(' *'), "bad infallible type" tmpl = attr_refcnt_infallible_tmpl realtype = realtype[:-2] # strip trailing pointer diff --git a/xpcom/idl-parser/xpidl/xpidl.py b/xpcom/idl-parser/xpidl/xpidl.py index 764ef974559c..a0a2f910e975 100755 --- a/xpcom/idl-parser/xpidl/xpidl.py +++ b/xpcom/idl-parser/xpidl/xpidl.py @@ -1041,9 +1041,10 @@ class Attribute(object): if self.infallible and self.realtype.kind not in ['builtin', 'interface', 'forward', - 'webidl']: + 'webidl', + 'cenum']: raise IDLError('[infallible] only works on interfaces, domobjects, and builtin types ' - '(numbers, booleans, and raw char types)', + '(numbers, booleans, cenum, and raw char types)', self.location) if self.infallible and not iface.attributes.builtinclass: raise IDLError('[infallible] attributes are only allowed on '