Boh.... Secondo me il codice non basta x essere funzionante.
Ho tradotto il suo codice in un'altra maniera per scrivere gli oggetti e vedrai che ho dovuto aggiungere delle dichiarazioni.
codice:
<script language="JavaScript" type="text/javascript">
<!--
function Parenizor(value) {
this.value = null;
this.setValue = _setValue;
this.toString = _toString;
this.getValue = _getValue;
//
this.setValue(value);
}
function _setValue(value) {
this.value = value;
return this;
}
function _getValue() {
return this.value;
}
function _toString() {
return '(' + this.getValue() + ')';
}
myParenizor = new Parenizor(0);
myString = myParenizor.toString();
alert(myString);
//-->
</script>