1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/jaeger/propertyOptimize-1.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,29 @@ 1.4 + 1.5 +function Foo(x) 1.6 +{ 1.7 + this.f = x + 10; 1.8 +} 1.9 + 1.10 +function Bar() 1.11 +{ 1.12 + this.g = 0; 1.13 +} 1.14 + 1.15 +Bar.prototype = Foo.prototype; 1.16 + 1.17 +var x = new Foo(0); 1.18 +var y = new Bar(); 1.19 + 1.20 +assertEq(10, eval("x.f")); 1.21 +assertEq(undefined, eval("y.f")); 1.22 + 1.23 +function Other(x) 1.24 +{ 1.25 + this.f = x + 10; 1.26 +} 1.27 + 1.28 +var a = new Other(0); 1.29 +var b = Object.create(Other.prototype); 1.30 + 1.31 +assertEq(10, eval("a.f")); 1.32 +assertEq(undefined, eval("b.f"));