I've been looking through the docs and various discussions but I have yet
to see an answer to these two questions that I have:
1. Do literally defined objects with the same structure (ex: {a: 1,
b:'hat'} and {a:7, b:'shoes'}) use the same hidden class?
2. If the answer to (1) is no: Would a dynamic constructor work?
Example of what I mean by a dynamic constructor...
function ObjFromLiteral(literal) {
for(prop in literal) {
this[prop] = literal[prop];
}
return this;
}
var O1 = new ObjFromLiteral({a: 1, b:'hat'});
var O2 = new ObjFromLiteral({a:7, b:'shoes'});
Would they then share a hidden class?
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users