1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/js1_8_5/regress/regress-571014.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,32 @@ 1.4 + 1.5 +var F, o; 1.6 + 1.7 +F = function () {}; 1.8 +F.prototype = new ArrayBuffer(1); 1.9 +o = new F(); 1.10 +try { 1.11 + o.byteLength; 1.12 +} catch (ex) { 1.13 + // o is not a platform object 1.14 + assertEq(ex instanceof TypeError, true); 1.15 +} 1.16 + 1.17 +o = {}; 1.18 +o.__proto__ = new Int32Array(1); 1.19 +try { 1.20 + o.buffer.byteLength; 1.21 +} catch (ex) { 1.22 + // o is not a platform object 1.23 + assertEq(ex instanceof TypeError, true); 1.24 +} 1.25 + 1.26 +F = function () {}; 1.27 +F.prototype = new Int32Array(1); 1.28 +o = new F(); 1.29 +try { 1.30 + o.slice(0, 1); 1.31 + reportFailure("Expected an exception!"); 1.32 +} catch (ex) { 1.33 +} 1.34 + 1.35 +reportCompare("ok", "ok", "bug 571014");