Bug 1387803 - Remove the [deprecated] annotation from XPIDL. r?froydnj
MozReview-Commit-ID: 1TOAHAgyf1y
--- a/xpcom/idl-parser/xpidl/header.py
+++ b/xpcom/idl-parser/xpidl/header.py
@@ -61,22 +61,20 @@ def attributeParamlist(a, getter):
attributeParamName(a))]
if a.implicit_jscontext:
l.insert(0, "JSContext* cx")
return ", ".join(l)
def attributeAsNative(a, getter, declType = 'NS_IMETHOD'):
- deprecated = a.deprecated and "NS_DEPRECATED " or ""
- params = {'deprecated': deprecated,
- 'returntype': attributeReturnType(a, declType),
+ params = {'returntype': attributeReturnType(a, declType),
'binaryname': attributeNativeName(a, getter),
'paramlist': attributeParamlist(a, getter)}
- return "%(deprecated)s%(returntype)s %(binaryname)s(%(paramlist)s)" % params
+ return "%(returntype)s %(binaryname)s(%(paramlist)s)" % params
def methodNativeName(m):
return m.binaryname is not None and m.binaryname or firstCap(m.name)
def methodReturnType(m, macro):
"""macro should be NS_IMETHOD or NS_IMETHODIMP"""
@@ -388,18 +386,16 @@ def write_interface(iface, fd):
foundcdata = False
for m in iface.members:
if isinstance(m, xpidl.CDATA):
foundcdata = True
if not foundcdata:
fd.write("NS_NO_VTABLE ")
- if iface.attributes.deprecated:
- fd.write("MOZ_DEPRECATED ")
fd.write(iface.name)
if iface.base:
fd.write(" : public %s" % iface.base)
fd.write(iface_prolog % names)
for key, group in itertools.groupby(iface.members, key=type):
if key == xpidl.ConstMember:
write_const_decls(group) # iterator of all the consts
--- a/xpcom/idl-parser/xpidl/runtests.py
+++ b/xpcom/idl-parser/xpidl/runtests.py
@@ -28,25 +28,24 @@ class TestParser(unittest.TestCase):
def testInterface(self):
i = self.p.parse("[uuid(abc)] interface foo {};", filename='f')
self.assertTrue(isinstance(i, xpidl.IDL))
self.assertTrue(isinstance(i.productions[0], xpidl.Interface))
self.assertEqual("foo", i.productions[0].name)
def testAttributes(self):
- i = self.p.parse("[scriptable, builtinclass, function, deprecated, uuid(abc)] interface foo {};", filename='f')
+ i = self.p.parse("[scriptable, builtinclass, function, uuid(abc)] interface foo {};", filename='f')
self.assertTrue(isinstance(i, xpidl.IDL))
self.assertTrue(isinstance(i.productions[0], xpidl.Interface))
iface = i.productions[0]
self.assertEqual("foo", iface.name)
self.assertTrue(iface.attributes.scriptable)
self.assertTrue(iface.attributes.builtinclass)
self.assertTrue(iface.attributes.function)
- self.assertTrue(iface.attributes.deprecated)
i = self.p.parse("[noscript, uuid(abc)] interface foo {};", filename='f')
self.assertTrue(isinstance(i, xpidl.IDL))
self.assertTrue(isinstance(i.productions[0], xpidl.Interface))
iface = i.productions[0]
self.assertEqual("foo", iface.name)
self.assertTrue(iface.attributes.noscript)
--- a/xpcom/idl-parser/xpidl/xpidl.py
+++ b/xpcom/idl-parser/xpidl/xpidl.py
@@ -597,17 +597,16 @@ class Interface(object):
return total
class InterfaceAttributes(object):
uuid = None
scriptable = False
builtinclass = False
function = False
- deprecated = False
noscript = False
main_process_scriptable_only = False
def setuuid(self, value):
self.uuid = value.lower()
def setscriptable(self):
self.scriptable = True
@@ -616,29 +615,25 @@ class InterfaceAttributes(object):
self.function = True
def setnoscript(self):
self.noscript = True
def setbuiltinclass(self):
self.builtinclass = True
- def setdeprecated(self):
- self.deprecated = True
-
def setmain_process_scriptable_only(self):
self.main_process_scriptable_only = True
actions = {
'uuid': (True, setuuid),
'scriptable': (False, setscriptable),
'builtinclass': (False, setbuiltinclass),
'function': (False, setfunction),
'noscript': (False, setnoscript),
- 'deprecated': (False, setdeprecated),
'object': (False, lambda self: True),
'main_process_scriptable_only': (False, setmain_process_scriptable_only),
}
def __init__(self, attlist, location):
def badattribute(self):
raise IDLError("Unexpected interface attribute '%s'" % name, location)
@@ -711,17 +706,16 @@ class Attribute(object):
noscript = False
readonly = False
implicit_jscontext = False
nostdcall = False
must_use = False
binaryname = None
null = None
undefined = None
- deprecated = False
infallible = False
def __init__(self, type, name, attlist, readonly, location, doccomments):
self.type = type
self.name = name
self.attlist = attlist
self.readonly = readonly
self.location = location
@@ -759,18 +753,16 @@ class Attribute(object):
else:
if value is not None:
raise IDLError("Unexpected attribute value", aloc)
if name == 'noscript':
self.noscript = True
elif name == 'implicit_jscontext':
self.implicit_jscontext = True
- elif name == 'deprecated':
- self.deprecated = True
elif name == 'nostdcall':
self.nostdcall = True
elif name == 'must_use':
self.must_use = True
elif name == 'infallible':
self.infallible = True
else:
raise IDLError("Unexpected attribute '%s'" % name, aloc)
@@ -817,17 +809,16 @@ class Method(object):
kind = 'method'
noscript = False
notxpcom = False
binaryname = None
implicit_jscontext = False
nostdcall = False
must_use = False
optional_argc = False
- deprecated = False
def __init__(self, type, name, attlist, paramlist, location, doccomments, raises):
self.type = type
self.name = name
self.attlist = attlist
self.params = paramlist
self.location = location
self.doccomments = doccomments
@@ -848,18 +839,16 @@ class Method(object):
if name == 'noscript':
self.noscript = True
elif name == 'notxpcom':
self.notxpcom = True
elif name == 'implicit_jscontext':
self.implicit_jscontext = True
elif name == 'optional_argc':
self.optional_argc = True
- elif name == 'deprecated':
- self.deprecated = True
elif name == 'nostdcall':
self.nostdcall = True
elif name == 'must_use':
self.must_use = True
else:
raise IDLError("Unexpected attribute '%s'" % name, aloc)
self.namemap = NameMap()