Closed
Bug 477735
Opened 17 years ago
Closed 17 years ago
XPCOMUtils.generateQI should handle nulls in argument array
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
mozilla1.9.2a1
People
(Reporter: vlad, Assigned: vlad)
References
Details
(Keywords: fixed1.9.1, Whiteboard: [fixed1.9.1b99])
Attachments
(1 file)
610 bytes,
patch
|
sayrer
:
review+
beltzner
:
approval1.9.1+
|
Details | Diff | Splinter Review |
This is kind of an edge case, but if an interface doesn't exist when accessed via Components.interfaces.nsIFoo, we'll get undef in the array; generateQI will then blow up when it tries to do "i.name".
This happened when building the extension manager but with --disable-xpinstall; the EM .js file has generateQI([Ci.nsIXPIBlah]) where nsIXPIBlah was an xpinstall interface, and caused a blow up.
This patch just walks through the array and only adds non-null/undef names to the array for the call to makeQI.
Attachment #361435 -
Flags: review?(sayrer)
Comment 1•17 years ago
|
||
Comment on attachment 361435 [details] [diff] [review]
make generateQI handle null/undef members in array
[Checkin: Comment 3 & 7]
should still be a one-liner, though.
js> var interfaces = [{"name":"foo"}, null, {"name":"bar"}, undefined, {"name":"baz"}]
js> var x = [i.name for each (i in interfaces) if (i)]
js> x.length
3
js> x
foo,bar,baz
js>
Attachment #361435 -
Flags: review?(sayrer) → review+
Assignee | ||
Comment 2•17 years ago
|
||
Man, that's starting to look like perlesque line noise ;)
Sounds good though, will update.
Assignee | ||
Comment 3•17 years ago
|
||
Checked in with the one-liner, 0ce096d6b9df
Assignee | ||
Updated•17 years ago
|
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Assignee: nobody → vladimir
Target Milestone: --- → mozilla1.9.2a1
Version: unspecified → Trunk
Updated•16 years ago
|
Attachment #361435 -
Flags: approval1.9.1?
Comment 4•16 years ago
|
||
Comment on attachment 361435 [details] [diff] [review]
make generateQI handle null/undef members in array
[Checkin: Comment 3 & 7]
Can't hurt, and would help bug 484579 comment 33 for example.
Comment 6•16 years ago
|
||
Comment on attachment 361435 [details] [diff] [review]
make generateQI handle null/undef members in array
[Checkin: Comment 3 & 7]
a191=beltzner
Attachment #361435 -
Flags: approval1.9.1? → approval1.9.1+
Comment 7•16 years ago
|
||
Comment on attachment 361435 [details] [diff] [review]
make generateQI handle null/undef members in array
[Checkin: Comment 3 & 7]
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/aeffb6e8a4cc
Attachment #361435 -
Attachment description: make generateQI handle null/undef members in array → make generateQI handle null/undef members in array
[Checkin: Comment 3 & 7]
Updated•16 years ago
|
Updated•16 years ago
|
Whiteboard: [fixed1.9.1b5] → [fixed1.9.1b99]
You need to log in
before you can comment on or make changes to this bug.
Description
•