code: public static Scriptable getClassPrototype(Scriptable scope,
                                                 String className)
      {
          scope = getTopLevelScope(scope);
          Object ctor = getProperty(scope, className);
          Object proto;
          if (ctor instanceof BaseFunction) {
              proto = ((BaseFunction)ctor).getPrototypeProperty();
          } else if (ctor instanceof Scriptable) {
              Scriptable ctorObj = (Scriptable)ctor;
              proto = ctorObj.get("prototype", ctorObj);
          } else {
              return null;
          }
          if (proto instanceof Scriptable) {
              return (Scriptable)proto;
          }
          return null;
      }
docs: Get the prototype for the named class.
  
  For example, <code>getClassPrototype(s, "Date")</code> will first
  walk up the parent chain to find the outermost scope, then will
  search that scope for the Date constructor, and then will
  return Date.prototype. If any of the lookups fail, or
  the prototype is not a JavaScript object, then null will
  be returned.
  
  @param scope an object in the scope chain
  @param className the name of the constructor
  @return the prototype for the named class, or null if it
  cannot be found.