This is a JS object by Bob Clary that serves as a base object in a JS
hiarchy, it has an explicit call to destroy() built in with a brief
discussion as to why it's needed.

http://www.mindspring.com/~bobclary/base/docs/xbObject.html

Class xbObject NameClass xbObject - root of Javascript Class Hierarchy
Synopsisclass xbObject
{
  // constructor
  xbObject();

  // methods
  void init();
  void destroy();
  Variant parentMethod(String methodName, ...);

  // properties
  String isa;
  Object classRef;
}

Sourcebase/xbObjects.js

See Also_Classes

DescriptionxbObject is the root of the Class hierarchy. It serves as a means
of guaranteeing that all classes have the minimal support required. It also
is a means of quickly adding new features to all classes. xbObject is not
intended to be instantiated.

Propertiesisa
readonly String - Class Name.

classRef
readonly Object - reference to the entry for this class in the _classes
object.

MethodsxbObject()
Constructs an instance of the xbObject class.

Returns nothing

Exceptions

None

destroy()
Destroy instances of a class. Javascript does not automatically call
destructors and relies totally upon garbage collection. You must explicitly
call destroy if an instance of a class requires destroying. Destructors are
especially important in long running scripts that make use of self
referential data structures which are never automatically garbage collected.
To chain destructors, perform any finalization of the current class and then
call the parent's destroy method last.

Returns Nothing

Exceptions

None

parentMethod(String methodName, ....)
Call an overridden method of a parent class. The first argument is the name
of the method to be called with the remaining arguments corresponding to the
parent's method's arguments. If the parent method returns a value,
parentMethod will return the value as well.

Returns Variant What ever the parent method returns.

Exceptions

What ever the parent method throws

xbObjects.ZIP

Reply via email to