mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 00:32:11 +00:00
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
This commit is contained in:
parent
49f92aabe5
commit
b1d077a87a
@ -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
|
||||
|
@ -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 '
|
||||
|
Loading…
Reference in New Issue
Block a user