1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/basic/testBug502914.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,19 @@ 1.4 +function testBug502914() { 1.5 + // Assigning a non-function to a function-valued property on trace should 1.6 + // bump the shape. 1.7 + function f1() {} 1.8 + function C() {} 1.9 + var x = C.prototype = {m: f1}; 1.10 + x.m(); // brand scope 1.11 + var arr = [new C, new C, new C, x]; 1.12 + try { 1.13 + for (var i = 0; i < 4; i++) { 1.14 + arr[i].m = 12; 1.15 + x.m(); // should throw last time through 1.16 + } 1.17 + } catch (exc) { 1.18 + return exc.constructor.name; 1.19 + } 1.20 + return "no exception"; 1.21 +} 1.22 +assertEq(testBug502914(), "TypeError");