js/src/jit-test/tests/jaeger/testSetElem-Easy.js

Thu, 15 Jan 2015 21:13:52 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:13:52 +0100
branch
TOR_BUG_9701
changeset 12
7540298fafa1
permissions
-rw-r--r--

Remove forgotten relic of ABI crash risk averse overloaded method change.

michael@0 1 // vim: set ts=8 sts=4 et sw=4 tw=99:
michael@0 2
michael@0 3 function testBadSetElems(obj, key) {
michael@0 4 obj[key] = 5;
michael@0 5 obj[-1] = 5;
michael@0 6 var L = obj;
michael@0 7 L[L] = L;
michael@0 8 obj = [];
michael@0 9 obj.K = 5;
michael@0 10 obj[2] = 5;
michael@0 11 var T = "a";
michael@0 12 obj[T] = 12;
michael@0 13 obj = [];
michael@0 14 obj[Object] = key;
michael@0 15 }
michael@0 16
michael@0 17 function testDenseSets(L) {
michael@0 18 var obj = [,,,,,,,,,,];
michael@0 19 obj[2] = 2;
michael@0 20 assertEq(obj[2], 2);
michael@0 21 var T = L;
michael@0 22 assertEq(obj[T], 2);
michael@0 23 assertEq(obj.length, 10);
michael@0 24 obj[10] = T;
michael@0 25 assertEq(obj[10], T);
michael@0 26 assertEq(obj.length, 11);
michael@0 27 var K = T + 9;
michael@0 28 obj[K] = K;
michael@0 29 assertEq(obj[K], K);
michael@0 30 assertEq(obj.length, 12);
michael@0 31 obj[K + 1] = obj;
michael@0 32 assertEq(obj[K + 1], obj);
michael@0 33 assertEq(obj.length, 13);
michael@0 34 }
michael@0 35
michael@0 36 for (var i = 0; i < 10; i++) {
michael@0 37 testBadSetElems([], -1);
michael@0 38 testDenseSets(2);
michael@0 39 }
michael@0 40
michael@0 41

mercurial