Answered at
https://stackoverflow.com/questions/47580935/v8-hidden-classes-for-two-objects-of-the-same-type-are-not-the-same-if-property
.


On Thu, Nov 30, 2017 at 11:20 AM Varik Matevosyan <[email protected]>
wrote:

> function Vector(a, b) {
>
>   this.a = a;
>   this.b = b;}
> var x = new Vector(1, 2);var y = new Vector(1, 3);var z = new Vector(1, 'a');
> print( %HaveSameMap( x, y ) ); //trueprint( %HaveSameMap( x, z ) ); //false
> x.b;print( %HaveSameMap( x, z ) ); //trueprint( %HaveSameMap( y, z ) ); 
> //false
> y.b;print( %HaveSameMap( y, z ) ); //true
>
> As we can see if the object property types are different they don't share
> their hidden class until we try to access the property in elder object
> which type is different. Can anyone give a clear explanation what is
> happening "behind the scenes".
>
> --
> --
> v8-dev mailing list
> [email protected]
> http://groups.google.com/group/v8-dev
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to