Closed
Bug 766615
Opened 13 years ago
Closed 13 years ago
Fix nullable WebIDL dictionaries
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla16
People
(Reporter: Ms2ger, Assigned: Ms2ger)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
2.30 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
Output looks like
const Nullable<MozXMLHttpRequestParameters> arg0;
if ((0 < argc ? argv[0] : JSVAL_NULL).isObject()) {
if (!const_cast<Nullable<MozXMLHttpRequestParameters>&>(arg0).SetValue().Init(cx, &(0 < argc ? argv[0] : JSVAL_NULL).toObject())) {
return false;
}
} else if ((0 < argc ? argv[0] : JSVAL_NULL).isNullOrUndefined()) {
const_cast<Nullable<MozXMLHttpRequestParameters>&>(arg0).SetNull();
} else {
return Throw<false>(cx, NS_ERROR_XPC_BAD_CONVERT_JS);
}
Attachment #634965 -
Flags: review?(bzbarsky)
![]() |
||
Comment 1•13 years ago
|
||
Comment on attachment 634965 [details] [diff] [review]
Patch v1
>+ if not type.nullable():
>+ selfRef = "const_cast<%s&>(%s)" % (typeName, selfRef)
Is that if check just needed to avoid a const_cast that would be a no-op? If so, I wouldn't bother checking, and just const_cast unconditionally.
r=me
Attachment #634965 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 2•13 years ago
|
||
Alright, then you get
if (!const_cast<MozXMLHttpRequestParametersWorkers&>(const_cast<Nullable<MozXMLHttpRequestParametersWorkers>&>(arg0).SetValue()).Init(cx, &(0 < argc ? argv[0] : JSVAL_NULL).toObject())) {
![]() |
||
Comment 3•13 years ago
|
||
> Alright, then you get
Yep. Looks good to me! ;)
Assignee | ||
Comment 4•13 years ago
|
||
Blocks: ParisBindings
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
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
•