Commit b1d077a8 authored by Kyle Machulis's avatar Kyle Machulis
Browse files

Bug 1505891 - Allow XPIDL CEnums to be infallible; r=froydnj

They're just integers, so there's no reason they need to be fallible
since they're basically a built-in anyways.

Differential Revision: https://phabricator.services.mozilla.com/D11363

--HG--
extra : moz-landing-system : lando
parent 49f92aab
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+3 −2
Original line number Diff line number Diff line
@@ -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 '