Closed
Bug 815502
Opened 12 years ago
Closed 12 years ago
Implement variadic arguments for WebIDL methods
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete)
Attachments
(2 files)
27.83 KB,
patch
|
peterv
:
review+
khuey
:
review+
|
Details | Diff | Splinter Review |
1.63 KB,
patch
|
Details | Diff | Splinter Review |
This is needed for things like the recent changes to ClassList.add/remove.
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #685723 -
Flags: review?(peterv)
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → bzbarsky
Whiteboard: [need review]
Comment on attachment 685723 [details] [diff] [review]
Implement support for variadic arguments in WebIDL.
Review of attachment 685723 [details] [diff] [review]:
-----------------------------------------------------------------
r=me on the WebIDL.py bits.
Attachment #685723 -
Flags: review+
Comment 3•12 years ago
|
||
Comment on attachment 685723 [details] [diff] [review]
Implement support for variadic arguments in WebIDL.
Review of attachment 685723 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/bindings/Codegen.py
@@ +3068,5 @@
> +
> + # NOTE: Keep this in sync with sequence conversions as needed
> + variadicConversion = string.Template("""const ${seqType} ${declName};
> +if (${argc} > ${index}) {
> + ${seqType} &arr = const_cast< ${seqType}& >(${declName});
I think we usually do |${seqType}& arr|.
@@ +3074,5 @@
> + if (!arr.SetCapacity(${argc} - ${index})) {
> + JS_ReportOutOfMemory(cx);
> + return false;
> + }
> + for (uint32_t variadicArg = 0; variadicArg < length; ++variadicArg) {
How do you feel about making this go from ${index} to ${argc} (and val would just be ${argv}[variadicArg]). I think that would be slightly clearer.
@@ +6819,5 @@
>
> class CGNativeMember(ClassMethod):
> def __init__(self, descriptor, member, name, signature, extendedAttrs,
> breakAfter=True, passCxAsNeeded=True, visibility="public",
> + jsObjectsArePtr=False, variadicIsSequence=False):
Could you explain variadicIsSequence, when would one pass in (the default) False?
Assignee | ||
Comment 4•12 years ago
|
||
> I think we usually do |${seqType}& arr|.
Done.
> How do you feel about making this go from ${index} to ${argc}
Done.
> Could you explain variadicIsSequence, when would one pass in (the default) False?
And have it actually matter? Right now, for callback function codegen, which takes an nsTArray for variadics, not a Sequence.
Assignee | ||
Comment 5•12 years ago
|
||
Updated•12 years ago
|
Attachment #685723 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 6•12 years ago
|
||
Flags: in-testsuite+
Keywords: dev-doc-needed
Whiteboard: [need review]
Target Milestone: --- → mozilla20
Assignee | ||
Comment 7•12 years ago
|
||
Keywords: dev-doc-needed → dev-doc-complete
Comment 8•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•