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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 if (typeof TypedObject === 'undefined')
michael@0 2 quit();
michael@0 3
michael@0 4 var StructType = TypedObject.StructType;
michael@0 5 var uint8 = TypedObject.uint8;
michael@0 6
michael@0 7 function check(c) {
michael@0 8 assertEq(c.r, 129);
michael@0 9 }
michael@0 10
michael@0 11 function run() {
michael@0 12 var RgbColor = new StructType({r: uint8, g: uint8, b: uint8});
michael@0 13 var Fade = new StructType({from: RgbColor, to: RgbColor});
michael@0 14
michael@0 15 var BrgColor = new StructType({b: uint8, r: uint8, g: uint8});
michael@0 16 var BrgFade = new StructType({from: BrgColor, to: BrgColor});
michael@0 17
michael@0 18 var gray = new RgbColor({r: 129, g: 128, b: 127});
michael@0 19
michael@0 20 var fade = new Fade({from: gray, to: gray});
michael@0 21 fade.to = {r: 129, g: 128, b: 127};
michael@0 22
michael@0 23 var brgGray = new BrgColor(gray);
michael@0 24 fade.from = brgGray;
michael@0 25
michael@0 26 var brgFade = new BrgFade(fade);
michael@0 27
michael@0 28 check(fade.to);
michael@0 29 check(brgFade.to);
michael@0 30 check(fade.to);
michael@0 31 check(brgFade.to);
michael@0 32 }
michael@0 33
michael@0 34 run();

mercurial