Not sure... but i'd start by inspecting it, using various different
"classes"...
for (var p in oMyInstance.constructor)
{
for (var p in oMyInstance.constructor)
{
alert("p = " +
oMyInstance[p]);
} Seems to point to nothing in Firefox anyway, the only
property returned is: color='purple';
<script type="text/_javascript_">
var test = function () {}
test.prototype = {color: 'red'};
var oTest1 = new test();
var oTest2 = new test();
oTest2.__proto__.color = 'blue';
alert('oTest1:color=' + oTest1.color + ' oTest2:color=' + oTest2.color);
test.prototype.color = 'green';
alert('oTest1:color=' + oTest1.color + ' oTest2:color=' + oTest2.color);
oTest1.constructor.prototype.color = 'purple';
alert('oTest1:color=' + oTest1.color + ' oTest2:color=' + oTest2.color);
var test = function () {}
test.prototype = {color: 'red'};
var oTest1 = new test();
var oTest2 = new test();
oTest2.__proto__.color = 'blue';
alert('oTest1:color=' + oTest1.color + ' oTest2:color=' + oTest2.color);
test.prototype.color = 'green';
alert('oTest1:color=' + oTest1.color + ' oTest2:color=' + oTest2.color);
oTest1.constructor.prototype.color = 'purple';
alert('oTest1:color=' + oTest1.color + ' oTest2:color=' + oTest2.color);
for (var p in oTest1.constructor) {
alert(p + " = " + oTest1.constructor[p]); // color=purple
}
_______________________________________________ Rails-spinoffs mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
