[Jslib] A bug in RDFContainer.getNode()?

Wei Wang ww9rivers at sbcglobal.net
Thu Apr 28 16:21:18 EDT 2005


Greetings,

Following is the function in JSlib 0.1.278:

RDFContainer.prototype.getNode = function(aNode) {
  var rv = null;
  if(this.isValid()) {
    var res = this.RDF.GetResource(this.subject+":"+aNode);
    if(res) {
      return new RDFResource("node", this.subject+":"+aNode, this.subject, this.dsource);
    }
  } else {
      jslibError(null, "RDFContainer is no longer valid!\n", "NS_ERROR_UNEXPECTED",
            JS_RDFCONTAINER_FILE+":getNode");
    return null;
  }
};


Shouldn't the "return null;" be put before the end bracket of the
function? Also, the variable "rv" is not used.

Regards,
-- 
Wei



More information about the Jslib mailing list