Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


The bound object need not be a script object. It could be a Java object as well - usual Java bean style getter/setter properties will be bound. Also a property only with getter will be bound as read-only property.

The source object bound can be a ScriptObject or a ScriptOjectMirror.
null or undefined source object results in TypeError being thrown.

Limitations of property binding:

* Only enumerable, immediate (not proto inherited) properties of the source object are bound.
* If the target object already contains a property called "foo", the source's "foo" is skipped (not bound). * Properties added to the source object after binding to the target are not bound. * Property configuration changes on the source object (or on the target) is not propagated.
* Delete of property on the target (or the source) is not propagated -
* only the property value is set to 'undefined' if the property happens to be a data property.
It is recommended that the bound properties be treated as non-configurable
properties to avoid surprises.

Extensions of Error objects, Error.prototype and Error constructor

...