UIZE JavaScript Framework

2009 NEWS 2009-03-05 - IMPROVED METHOD: toString Intrinsic Method

The toString Intrinsic Method that is implemented in the Uize base class has been improved to better support package modules and also to do a better job of representing state property values that are class or package references when producing summaries for instances or classes.

1. Support for Package Modules

The toString Intrinsic Method now is implemented for package modules that are declared using the Uize.module static method.

This means that alerting the value of a package using JavaScript's built-in alert function now produces a more useful result.

EXAMPLE

alert (Uize.Node);

PREVIOUSLY

[object Function]

NOW

[package Uize.Node]

2. Better Summaries for Instances and Classes

The toString Intrinsic Method now does a better job of representing state property values that are class or package references when producing summaries for instances or classes.

EXAMPLE

widget = new Uize.Widget;
widget.set ({
  aClass:Uize.Widget,
  aPackage:Uize.Node
});
alert (widget);

PREVIOUSLY

[object Uize.Widget]

aClass : [object Function]
aPackage : [object Function]
... ... ...
... ... ...
... ... ...

NOW

[object Uize.Widget]

aClass : [class Uize.Widget]
aPackage : [package Uize.Node]
... ... ...
... ... ...
... ... ...