js/src/jit-test/tests/basic/bug641525.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
michael@0 2 var o2 = Proxy.create({});
michael@0 3 function f1() {}
michael@0 4 function f2() {}
michael@0 5 function f4(o) {
michael@0 6 var key = Object.getOwnPropertyNames(o)[18];
michael@0 7 o4 = o[key];
michael@0 8 o.prototype = {};
michael@0 9 }
michael@0 10 f4(f1);
michael@0 11 f4(f1);
michael@0 12 f4(f2);
michael@0 13 new f2(o2);
michael@0 14
michael@0 15 // these will hold only if type inference is enabled.
michael@0 16 //assertEq(shapeOf(f1) == shapeOf(f2), false);
michael@0 17 //assertEq(shapeOf(f1) == shapeOf(f4), false);
michael@0 18
michael@0 19 function factory() {
michael@0 20 function foo() {}
michael@0 21 foo.x = 0;
michael@0 22 return foo;
michael@0 23 }
michael@0 24
michael@0 25 var fobjs = [];
michael@0 26 for (var i = 0; i < 10; i++) {
michael@0 27 var of = fobjs[i] = factory();
michael@0 28 if (i > 0) {
michael@0 29 assertEq(fobjs[i - 1] === of, false);
michael@0 30 assertEq(shapeOf(fobjs[i - 1]), shapeOf(of));
michael@0 31 }
michael@0 32 }
michael@0 33
michael@0 34 assertEq(shapeOf(fobjs[0]) == shapeOf(f1), false);

mercurial