diff --git a/xpcom/idl-parser/xpidl.py b/xpcom/idl-parser/xpidl.py index 56390d8c70f..55b201fe4c5 100644 --- a/xpcom/idl-parser/xpidl.py +++ b/xpcom/idl-parser/xpidl.py @@ -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