code: public void addAsConstructor(Scriptable scope, Scriptable prototype)
      {
          initAsConstructor(scope, prototype);
          defineProperty(scope, prototype.getClassName(),
                         this, ScriptableObject.DONTENUM);
      }
docs: Define this function as a JavaScript constructor.
  <p>
  Sets up the "prototype" and "constructor" properties. Also
  calls setParent and setPrototype with appropriate values.
  Then adds the function object as a property of the given scope, using
  <code>prototype.getClassName()</code>
  as the name of the property.
  
  @param scope the scope in which to define the constructor (typically
  the global object)
  @param prototype the prototype object
  @see org.mozilla.javascript.Scriptable#setParentScope
  @see org.mozilla.javascript.Scriptable#setPrototype
  @see org.mozilla.javascript.Scriptable#getClassName