js/src/jit-test/tests/jaeger/propertyOptimize-4.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/jaeger/propertyOptimize-4.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,17 @@
     1.4 +// Make sure new script properties can be invalidated on specialized prototype
     1.5 +// types while they are still being constructed.
     1.6 +
     1.7 +function Foo(a, b, c) {
     1.8 +  this.x = a + b;
     1.9 +  this.y = c;
    1.10 +}
    1.11 +
    1.12 +updated = false;
    1.13 +var o = {valueOf: function() {
    1.14 +    Object.defineProperty(Object.prototype, 'y', {set:function() { updated = true; }})
    1.15 +  }};
    1.16 +
    1.17 +function Bar() {}
    1.18 +Bar.prototype = new Foo(o, 1, 2);
    1.19 +assertEq(updated, true);
    1.20 +assertEq(Bar.prototype.y, undefined);

mercurial