js/src/tests/js1_8_5/regress/regress-571014.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 F, o;
michael@0 3
michael@0 4 F = function () {};
michael@0 5 F.prototype = new ArrayBuffer(1);
michael@0 6 o = new F();
michael@0 7 try {
michael@0 8 o.byteLength;
michael@0 9 } catch (ex) {
michael@0 10 // o is not a platform object
michael@0 11 assertEq(ex instanceof TypeError, true);
michael@0 12 }
michael@0 13
michael@0 14 o = {};
michael@0 15 o.__proto__ = new Int32Array(1);
michael@0 16 try {
michael@0 17 o.buffer.byteLength;
michael@0 18 } catch (ex) {
michael@0 19 // o is not a platform object
michael@0 20 assertEq(ex instanceof TypeError, true);
michael@0 21 }
michael@0 22
michael@0 23 F = function () {};
michael@0 24 F.prototype = new Int32Array(1);
michael@0 25 o = new F();
michael@0 26 try {
michael@0 27 o.slice(0, 1);
michael@0 28 reportFailure("Expected an exception!");
michael@0 29 } catch (ex) {
michael@0 30 }
michael@0 31
michael@0 32 reportCompare("ok", "ok", "bug 571014");

mercurial