summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testMethodWriteBarrier2.js
blob: 19b387198a13c3b488da729e98aa7cc1f343c806 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function C() {
    this.m = function () {};  // JSOP_SETMETHOD
}

var a = [new C, new C, new C, new C, new C, new C, new C, new C, new C];
var b = [new C, new C, new C, new C, new C, new C, a[8],  new C, new C];

var thrown = 'none';
try {
    for (var i = 0; i < 9; i++) {
	a[i].m();
	b[i].m = 0.7;  // MethodWriteBarrier required here
    }
} catch (exc) {
    thrown = exc.name;
}
assertEq(thrown, 'TypeError');