Closed Bug 14460 Opened 25 years ago Closed 23 years ago

XPConnect expects JS method QueryInterface, should use queryInterface

Categories

(Core :: XPConnect, defect, P3)

defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: shaver, Assigned: shaver)

References

Details

(Keywords: arch)

...because JS is interCaps (or to match, but we don't vary with declaration in
nsISupports.idl).
This sucks. In C++ we are trying to be compatible with IUnknown and IFactory
etc. But for JS even the lowest base interface is going to have incompatible
method names. People trying to recycle their JScript COM code will be even more
screwed then they would have been. Every flipping COM and xpcom document in the
world will be a source of disinformation for JS users. Do we really want to do
this?
I'm confused: C++ will be happy so long as XPIDL converts interCaps to
InterCaps, which it does.

Also, who could ever hope to recycle JScript COM code without changes?  Such
compatibility has been a non-goal, and I don't even know that JScript in MS's
world can call QueryInterface -- can it?

When we get components (.cdl files) flattening interfaces, JS users won't need
to QI much, if at all, so this is a low priority bug.  But I don't see where the
suckage is, given our interCap=>InterCaps C++ from XPIDL binding.

/be
JS component implementers will still need to name a method QueryInterface,
unlike all their other methods.

If our current XPCOM documentation doesn't tell JS users that their method names
match IDL case, and that IDL should be interCaps, then we should fix that too.
This is mostly brainprint pain - for me if no one else :)

Except for the brainprint issue, this is no different from our numerous
other cases where InterCaps are in the idl... there will be a lot of JS code to
be fixed and docs to be updated.
More to fix the longer we wait -- and the bad meme must not spread further.  OK,
shaver and I are up for an interCap tree spank when he gets here.  Who's agin'
us?

/be
I'm in 'whatever' mode. Let's remember that we need to make noise and get help.
There are things like docs and junk on branches and personal trees that need to
be fixed too. Sorry to repeat the obvious, but this is not like C++ where the
compiler will find these mismatches for us.
Status: NEW → ASSIGNED
shaver and brendan seemed to be voluteering to do this, yet the bug has been 
languishing on my list. There is a shitload of JS code that contains 
the string "QueryInterface". There are still other interfaces with InterCaps 
named methods (e.g. nsISimpleEnumerator::GetNext). If you're going to coordinate 
a giant renaming then fine. When?
Assignee: jband → shaver
Status: ASSIGNED → NEW
Moving all XPConnect QA contact to rginda
QA Contact: cbegle → rginda
Brendan, can you decide if this should be part of the arch-freeze, and if so
make it a dependent of your big arch-bug?
Status: NEW → ASSIGNED
Mozilla 0.9 or not at all.

I can whack all the code in the tree, but it's not clear whether xpconnect
should be following nsISupports.idl, in which case we also have to remove the
hardcoded spelling of QI from xpconnect.
Keywords: mozilla0.9
If this happens then, sure, nsISupports.idl has to change. I think the only 
instance of that string in xpconnect that matters is the string literal in 
xpcjsruntime.cpp.

The thing is that if you do this then *all* the JS code that calls QI needs to 
change. Lots of it is not in the mozilla tree. Worth the pain?
Yes, and the blame.  We will need newsgroup and www.mozilla.org anouncements of 
this. Anything else? Maybe we should do the documentation stuff first 
[new blocking bug]?
Keywords: arch
OS: Linux → All
Hardware: PC → All
I say we spend time on CDL and flattening and not worry about this.  I reread my
comments from more than a year ago, looked at nsISupports.idl, and can live with
the InterCaps for this one magic method, whose usage should go down over time in
JS.  I think we have bigger fish to fry.  I'm not confident we can pull of such
a renaming without some "crutch code" that tolerates qI and QI -- which will
just prolong the usage of QI.

I say WONTFIX, and re-document that interCaps should be used when naming XPIDL
attributes and methods (and ALL_CAPS when naming constants).

/be
Why is this still open? Nominating mozilla1.0 because this needs to be resolved
one way or another. It's been over a year since Brendan suggested WONTFIX, and
we can't leave the possibility of this changing hanging over people's heads.
Keywords: mozilla1.0
Beaten by my own laziness.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → WONTFIX
Blocks: 241261
You need to log in before you can comment on or make changes to this bug.