Part 3 of fix for bug 459452 (Add support for optional arg count for IDL methods): add support for [optional_argc] to quickstubs. r=jst.

--HG--
extra : rebase_source : 59f7c2481353bbd2bd00397c6faf5f0860d32c8e
This commit is contained in:
Peter Van der Beken 2009-08-10 16:41:15 +02:00
Родитель 8c1128c734
Коммит cc5de108f9
2 изменённых файлов: 8 добавлений и 3 удалений

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

@ -89,7 +89,7 @@ members = [
#
# nsIDOMCanvasRenderingContext2D
# NOTE: attributes strokeStyle and fillStyle are nsIVariant
# NOTE: drawImage(), getImageData(), and putImageData() use
# NOTE: getImageData(), and putImageData() use
# GetCurrentNativeCallContext
'nsIDOMCanvasRenderingContext2D.canvas',
'nsIDOMCanvasRenderingContext2D.save',
@ -126,6 +126,7 @@ members = [
'nsIDOMCanvasRenderingContext2D.fillText',
'nsIDOMCanvasRenderingContext2D.strokeText',
'nsIDOMCanvasRenderingContext2D.measureText',
'nsIDOMCanvasRenderingContext2D.drawImage',
'nsIDOMCanvasRenderingContext2D.isPointInPath',
'nsIDOMTextMetrics.width',
@ -386,7 +387,7 @@ members = [
'nsIDOMHTMLCanvasElement.width',
'nsIDOMHTMLCanvasElement.height',
'nsIDOMHTMLCanvasElement.getContext',
# 'nsIDOMHTMLCanvasElement.toDataURL', # uses GetCurrentNativeCallContext
'nsIDOMHTMLCanvasElement.toDataURL',
'nsIDOMNSHTMLAnchorElement.text',
'nsIDOMNSHTMLAnchorElement.search',
'nsIDOMNSHTMLAnchorElement.hash',
@ -402,6 +403,7 @@ members = [
'nsIDOMNSHTMLElement.offsetTop',
'nsIDOMNSHTMLElement.offsetHeight',
'nsIDOMNSHTMLElement.offsetWidth',
'nsIDOMNSHTMLElement.scrollIntoView',
'nsIDOMNSHTMLFrameElement.contentWindow',
'nsIDOMNSHTMLImageElement.complete',
'nsIDOMNSHTMLInputElement.files',
@ -410,6 +412,7 @@ members = [
'nsIDOMNSHTMLInputElement.selectionEnd',
'nsIDOMNSHTMLInputElement.setSelectionRange',
'nsIDOMNSHTMLOptionCollection.selectedIndex',
'nsIDOMNSHTMLOptionCollection.add',
'nsIDOMNSHTMLOptionElement.text',
'nsIDOMNSHTMLSelectElement.item',
'nsIDOMNSHTMLTextAreaElement.setSelectionRange',

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

@ -216,7 +216,7 @@ def addStubMember(memberId, member, traceable):
# Check for unknown properties.
for attrname, value in vars(member).items():
if value is True and attrname not in ('readonly',):
if value is True and attrname not in ('readonly','optional_argc',):
raise UserError("%s %s: unrecognized property %r"
% (member.kind.capitalize(), memberId,
attrname))
@ -836,6 +836,8 @@ def writeQuickStub(f, customMethodCalls, member, stubName, isSetter=False):
if isMethod:
comName = header.methodNativeName(member)
argv = ['arg' + str(i) for i, p in enumerate(member.params)]
if member.optional_argc:
argv.append('argc - %d' % requiredArgs)
if not isVoidType(member.realtype):
argv.append(outParamForm(resultname, member.realtype))
args = ', '.join(argv)