mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 21:00:50 +00:00
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:
parent
44b6eaffec
commit
9d2cf12ce4
@ -917,8 +917,6 @@ class Attribute(object):
|
|||||||
nostdcall = False
|
nostdcall = False
|
||||||
must_use = False
|
must_use = False
|
||||||
binaryname = None
|
binaryname = None
|
||||||
null = None
|
|
||||||
undefined = None
|
|
||||||
infallible = False
|
infallible = False
|
||||||
|
|
||||||
def __init__(self, type, name, attlist, readonly, location, doccomments):
|
def __init__(self, type, name, attlist, readonly, location, doccomments):
|
||||||
@ -938,56 +936,27 @@ class Attribute(object):
|
|||||||
self.binaryname = value
|
self.binaryname = value
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if name == 'Null':
|
if value is not None:
|
||||||
if value is None:
|
raise IDLError("Unexpected attribute value", aloc)
|
||||||
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 name == 'noscript':
|
if name == 'noscript':
|
||||||
self.noscript = True
|
self.noscript = True
|
||||||
elif name == 'symbol':
|
elif name == 'symbol':
|
||||||
self.symbol = True
|
self.symbol = True
|
||||||
elif name == 'implicit_jscontext':
|
elif name == 'implicit_jscontext':
|
||||||
self.implicit_jscontext = True
|
self.implicit_jscontext = True
|
||||||
elif name == 'nostdcall':
|
elif name == 'nostdcall':
|
||||||
self.nostdcall = True
|
self.nostdcall = True
|
||||||
elif name == 'must_use':
|
elif name == 'must_use':
|
||||||
self.must_use = True
|
self.must_use = True
|
||||||
elif name == 'infallible':
|
elif name == 'infallible':
|
||||||
self.infallible = True
|
self.infallible = True
|
||||||
else:
|
else:
|
||||||
raise IDLError("Unexpected attribute '%s'" % name, aloc)
|
raise IDLError("Unexpected attribute '%s'" % name, aloc)
|
||||||
|
|
||||||
def resolve(self, iface):
|
def resolve(self, iface):
|
||||||
self.iface = iface
|
self.iface = iface
|
||||||
self.realtype = iface.idl.getName(self.type, self.location)
|
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',
|
if self.infallible and self.realtype.kind not in ['builtin',
|
||||||
'interface',
|
'interface',
|
||||||
'forward',
|
'forward',
|
||||||
@ -1136,8 +1105,6 @@ class Param(object):
|
|||||||
retval = False
|
retval = False
|
||||||
shared = False
|
shared = False
|
||||||
optional = False
|
optional = False
|
||||||
null = None
|
|
||||||
undefined = None
|
|
||||||
default_value = None
|
default_value = None
|
||||||
|
|
||||||
def __init__(self, paramtype, type, name, attlist, location, realtype=None):
|
def __init__(self, paramtype, type, name, attlist, location, realtype=None):
|
||||||
@ -1158,21 +1125,6 @@ class Param(object):
|
|||||||
if value is None:
|
if value is None:
|
||||||
raise IDLError("'iid_is' must specify a parameter", aloc)
|
raise IDLError("'iid_is' must specify a parameter", aloc)
|
||||||
self.iid_is = value
|
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':
|
elif name == 'default':
|
||||||
if value is None:
|
if value is None:
|
||||||
raise IDLError("'default' must specify a default value", aloc)
|
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)
|
self.realtype = method.iface.idl.getName(self.type, self.location)
|
||||||
if self.array:
|
if self.array:
|
||||||
self.realtype = LegacyArray(self.realtype)
|
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):
|
def nativeType(self):
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user