My compiler discovered several places in the code where variables were being used before they were set. I took a look at the code and the compiler was right. These look like real bugs. I have attached a patch that fixes these problems.
CVS log says all these belong to norris.
The change in nsHTMLSelectElement.cpp appears already to have been made. All the nsJSXUL* files are generated by the DOM idl compiler. I tweaked that recently; thanks for catching the problems. I'll fix it by redoing the compiler.
actually, when I look at the latest version on the tip, all the declarations of nsresult rv are now initialized to NS_OK. So there shouldn't be any reads of uninitialized variables. I don't think I'll try to actually remove the declarations and usages of rv from the places you indicate. It's hard to detect those situations in the stub generator (see mozilla/dom/tools/JSStubGen.cpp), and a halfway decent optimizing compiler should do constant propagation and dead code elimination to produce the same effect.
Verified per norris' comments.