Re: [v8-users] Hidden Classes and Prototype Fields

2014-06-10 Thread Jakob Kummerow
In terms of hidden classes, there shouldn't be a difference. However, since you're setting valueA and valueB in the constructor, setting them on the prototype too seems entirely pointless to me. The prototype's values are never visible from instance objects, right? Unless you want to delete them

[v8-users] Hidden Classes and Prototype Fields

2014-06-06 Thread Si Robertson
Quick question for you guys. As far as V8 and its hidden classes are concerned, are there any pros or cons of doing the following ... function Foo() { this.valueA = 100; this.valueB = 200; } Foo.prototype.valueA = 0; Foo.prototype.valueB = 0; I'm curious if that code will cause