Closed Bug 766615 Opened 13 years ago Closed 13 years ago

Fix nullable WebIDL dictionaries

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: Ms2ger, Assigned: Ms2ger)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached patch Patch v1Splinter 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 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+
Alright, then you get if (!const_cast<MozXMLHttpRequestParametersWorkers&>(const_cast<Nullable<MozXMLHttpRequestParametersWorkers>&>(arg0).SetValue()).Init(cx, &(0 < argc ? argv[0] : JSVAL_NULL).toObject())) {
> Alright, then you get Yep. Looks good to me! ;)
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: