Bug 695235 - enforce unsigned long type on size_is parameters; r=khuey

This commit is contained in:
Nathan Froyd 2012-03-09 17:06:13 -05:00
parent 3b8fa0ab19
commit d0255ba171

View File

@ -919,6 +919,16 @@ class Method(object):
raise IDLError("'stringifier' attribute can only be used on methods returning DOMString",
self.location)
self.iface.ops['stringifier'] = self
for p in self.params:
if p.size_is:
found_size_param = False
for size_param in self.params:
if p.size_is == size_param.name:
found_size_param = True
if getBuiltinOrNativeTypeName(size_param.realtype) != 'unsigned long':
raise IDLError("is_size parameter must have type 'unsigned long'", self.location)
if not found_size_param:
raise IDLError("could not find is_size parameter '%s'" % p.size_is, self.location)
def isScriptable(self):
if not self.iface.attributes.scriptable: return False