Greetings all,
Does using the JavaScript "delete" keyword to delete a property from an
object effect how v8 will optimize the object? I've read that v8 creates
hidden "classes" to represent an object and all its various property
configurations. Does deleting a property just flip between two of these
hidden classes and is it less efficient than just nulling the local
property value?
Secondly, how will v8 handle the case where I have a prototype object with
"name" property and also a local property "name" and I delete the local
property to expose the prototype value again?
Example:
function Foo() {
this.name = 'foo';
}
function Bar() {}
Bar.prototype = new Foo();
var bar = new Bar();
bar.name = 'bar';
// later in the program...
delete bar.name; // exposes prototype name again (Foo's name).
Will using delete in such a manner prevent v8 from fully optimizing the
code? Or should I not worry about this usage?
Thank you very much for any insight!
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users