Status: New
Owner: ----

New issue 2426 by [email protected]: prototype can be readable after some tricky steps
http://code.google.com/p/v8/issues/detail?id=2426


Please refer to the code below, the output of car1.prototype and car2.prototype is different, after some tricky steps.

================================================================
function Car(name)
{
        this.Name = name;
}
var car1 = new Car("XXX");

function BatManCar(gunNumber)
{
        this.GunNumber = gunNumber;
}

// This is a tricky step, it will makes the prototype of all Cars created after this step to be exposed.
BatManCar.prototype = Car;
var batManCar = new BatManCar(4);
batManCar.prototype = Car;

var car2 = new Car("YYY");
console.log(car1.prototype); //undefined
console.log(car2.prototype); //[Function: Car]


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to