js/src/jit-test/tests/ion/bug980860.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/ion/bug980860.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,34 @@
     1.4 +if (typeof TypedObject === 'undefined')
     1.5 +    quit();
     1.6 +
     1.7 +var StructType = TypedObject.StructType;
     1.8 +var uint8 = TypedObject.uint8;
     1.9 +
    1.10 +function check(c) {
    1.11 +  assertEq(c.r, 129);
    1.12 +}
    1.13 +
    1.14 +function run() {
    1.15 +  var RgbColor = new StructType({r: uint8, g: uint8, b: uint8});
    1.16 +  var Fade = new StructType({from: RgbColor, to: RgbColor});
    1.17 +
    1.18 +  var BrgColor = new StructType({b: uint8, r: uint8, g: uint8});
    1.19 +  var BrgFade = new StructType({from: BrgColor, to: BrgColor});
    1.20 +
    1.21 +  var gray = new RgbColor({r: 129, g: 128, b: 127});
    1.22 +
    1.23 +  var fade = new Fade({from: gray, to: gray});
    1.24 +  fade.to = {r: 129, g: 128, b: 127};
    1.25 +
    1.26 +  var brgGray = new BrgColor(gray);
    1.27 +  fade.from = brgGray;
    1.28 +
    1.29 +  var brgFade = new BrgFade(fade);
    1.30 +
    1.31 +  check(fade.to);
    1.32 +  check(brgFade.to);
    1.33 +  check(fade.to);
    1.34 +  check(brgFade.to);
    1.35 +}
    1.36 +
    1.37 +run();

mercurial