summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/propertyOptimize-2.js
blob: 88df13e2c75620efbc44ea780e6395dfb3dab850 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function Foo(x)
{
  this.f = x + 10;
}

var x = new Foo(0);
assertEq(10, eval("x.f"));

called = false;
Object.defineProperty(Foo.prototype, 'f', {set: function() { called = true; }});

var y = new Foo(0);
assertEq(10, eval("x.f"));
assertEq(undefined, eval("y.f"));
assertEq(called, true);