Bug 243621 Standardize QueryInterface without throw

r=neil sr=darin


git-svn-id: svn://10.0.0.236/trunk@156489 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
timeless%mozdev.org
2004-05-17 23:38:25 +00:00
parent e885658ef4
commit d5f9c7bdbe
33 changed files with 809 additions and 762 deletions

View File

@@ -32,11 +32,12 @@ mySample.prototype = {
poke: function (aValue) { this.val = aValue; },
QueryInterface: function (iid) {
if (!iid.equals(Components.interfaces.nsISample) &&
!iid.equals(Components.interfaces.nsISupports)) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
if (iid.equals(Components.interfaces.nsISample) ||
iid.equals(Components.interfaces.nsISupports))
return this;
Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE;
return null;
},
val: "<default value>"
@@ -63,7 +64,7 @@ var myModule = {
compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
compMgr.registerFactoryLocation(this.myCID,
"Sample JS Component",
this.myProgID,
this.myProgID,
fileSpec,
location,
type);