Closed Bug 291721 Opened 20 years ago Closed 20 years ago

add ClassInfo to item and other interfaces

Categories

(Calendar :: Internal Components, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: vlad, Assigned: vlad)

Details

Attachments

(1 file)

To avoid QueryInterface() lameness, implement CI so that interface flattening can happen in JS.
Comment on attachment 181706 [details] [diff] [review] cal-add-classinfo.patch >Index: calAttendee.js > >+calAttendeeClassInfo = { >+ getInterfaces: function (count) { [...] >+ flags: 0 >+}; >+ >+ > calAttendee.prototype = { > QueryInterface: function (aIID) { > if (!aIID.equals(Components.interfaces.nsISupports) && > !aIID.equals(Components.interfaces.calIAttendee)) > { > throw Components.results.NS_ERROR_NO_INTERFACE; > } You should return the classinfo here, no? > calEvent.prototype = { > __proto__: calItemBase ? (new calItemBase()) : {}, > > QueryInterface: function (aIID) { > if (aIID.equals(Components.interfaces.calIEvent)) > return this; > >+ if (aIID.equals(Components.interfaces.nsIClassInfo)) >+ return calEventClassInfo; >+ > return this.__proto__.__proto__.QueryInterface.call(this, aIID); > }, What say you to just making this sClassInfo on the prototype, and teaching calItemBase's QI to return this.sClassInfo for nsIClassInfo? I guess it only saves event and todo for now, so I'm not that picky, but I thought I'd mention it. r=shaver if you actually return the attendee's classinfo somewhere, and check once for each class in xpcshell that the right things happen. =)
Attachment #181706 - Flags: first-review?(shaver) → first-review+
fixed and committed
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: