General Interface defines its own base class, jsx3.lang.Object, which adds the following capabilities to the JavaScript 1.x model:
- Obtaining the class that defines an instance with the getClass() method
- Calling an overridden method in a superclass with the jsxsuper() and jsxsupermix() methods
- A better toString() method that overrides Object.toString() and includes the name of the class from which the object was instantiated
- Introspection of class and interface membership using the instanceOf() method
The jsx3.lang.Object class works in conjunction with the other classes in the jsx3.lang package — Class, Exception, Method, and Package —to provide these further advantages over JavaScript 1.x:
- A rich exception model with intelligible stack traces
- Full introspection of classes and methods
- Mixin style interfaces
- Introspectable packages
- Simple declaration of classes and members using standard JavaScript 1.x syntax that frees the developer from the details of prototype inheritance
All classes in General Interface descend from jsx3.lang.Object. Developers are encouraged to extend the General Interface base class in application code in order to fully incorporate the features enumerated above.