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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user