Bug 1489010 - Remove XPIDL support for `Null` and `Undefined` value-taking properties on `DOMString` parameters and attributes. r=jorendorff

These properties were added in bug 478251 back when XPIDL was sort of emulating
WebIDL. They are not needed any more, and none of our XPIDL files use them.

--HG--
extra : rebase_source : f2f2c54ae787ad90704074eb114f00c3741d5f88
This commit is contained in:
Nicholas Nethercote 2018-09-06 13:42:05 +10:00
Родитель 44b6eaffec
Коммит 9d2cf12ce4
1 изменённых файлов: 16 добавлений и 72 удалений

Просмотреть файл

@ -917,8 +917,6 @@ class Attribute(object):
nostdcall = False
must_use = False
binaryname = None
null = None
undefined = None
infallible = False
def __init__(self, type, name, attlist, readonly, location, doccomments):
@ -938,56 +936,27 @@ class Attribute(object):
self.binaryname = value
continue
if name == 'Null':
if value is None:
raise IDLError("'Null' attribute requires a value", aloc)
if readonly:
raise IDLError("'Null' attribute only makes sense for setters",
aloc)
if value not in ('Empty', 'Null', 'Stringify'):
raise IDLError("'Null' attribute value must be 'Empty', 'Null' or 'Stringify'",
aloc)
self.null = value
elif name == 'Undefined':
if value is None:
raise IDLError("'Undefined' attribute requires a value", aloc)
if readonly:
raise IDLError("'Undefined' attribute only makes sense for setters",
aloc)
if value not in ('Empty', 'Null'):
raise IDLError("'Undefined' attribute value must be 'Empty' or 'Null'",
aloc)
self.undefined = value
else:
if value is not None:
raise IDLError("Unexpected attribute value", aloc)
if value is not None:
raise IDLError("Unexpected attribute value", aloc)
if name == 'noscript':
self.noscript = True
elif name == 'symbol':
self.symbol = True
elif name == 'implicit_jscontext':
self.implicit_jscontext = 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)
if name == 'noscript':
self.noscript = True
elif name == 'symbol':
self.symbol = True
elif name == 'implicit_jscontext':
self.implicit_jscontext = 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)
def resolve(self, iface):
self.iface = iface
self.realtype = iface.idl.getName(self.type, self.location)
if (self.null is not None and
getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'):
raise IDLError("'Null' attribute can only be used on DOMString",
self.location)
if (self.undefined is not None and
getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'):
raise IDLError("'Undefined' attribute can only be used on DOMString",
self.location)
if self.infallible and self.realtype.kind not in ['builtin',
'interface',
'forward',
@ -1136,8 +1105,6 @@ class Param(object):
retval = False
shared = False
optional = False
null = None
undefined = None
default_value = None
def __init__(self, paramtype, type, name, attlist, location, realtype=None):
@ -1158,21 +1125,6 @@ class Param(object):
if value is None:
raise IDLError("'iid_is' must specify a parameter", aloc)
self.iid_is = value
elif name == 'Null':
if value is None:
raise IDLError("'Null' must specify a parameter", aloc)
if value not in ('Empty', 'Null', 'Stringify'):
raise IDLError("'Null' parameter value must be 'Empty', 'Null', "
"or 'Stringify'",
aloc)
self.null = value
elif name == 'Undefined':
if value is None:
raise IDLError("'Undefined' must specify a parameter", aloc)
if value not in ('Empty', 'Null'):
raise IDLError("'Undefined' parameter value must be 'Empty' or 'Null'",
aloc)
self.undefined = value
elif name == 'default':
if value is None:
raise IDLError("'default' must specify a default value", aloc)
@ -1199,14 +1151,6 @@ class Param(object):
self.realtype = method.iface.idl.getName(self.type, self.location)
if self.array:
self.realtype = LegacyArray(self.realtype)
if (self.null is not None and
getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'):
raise IDLError("'Null' attribute can only be used on DOMString",
self.location)
if (self.undefined is not None and
getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'):
raise IDLError("'Undefined' attribute can only be used on DOMString",
self.location)
def nativeType(self):
kwargs = {}