js/src/tests/js1_8_5/regress/regress-571014.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

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