js/src/tests/js1_8/extensions/regress-476414-02.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 // |reftest| skip-if(!xulRuntime.shell) slow
michael@0 2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 3 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 //-----------------------------------------------------------------------------
michael@0 8 var BUGNUMBER = 476414;
michael@0 9 var summary = 'Do not crash @ js_NativeSet';
michael@0 10 var actual = '';
michael@0 11 var expect = '';
michael@0 12
michael@0 13 printBugNumber(BUGNUMBER);
michael@0 14 printStatus (summary);
michael@0 15
michael@0 16 function whatToTestSpidermonkeyTrunk(code)
michael@0 17 {
michael@0 18 return {
michael@0 19 allowExec: true
michael@0 20 };
michael@0 21 }
michael@0 22 whatToTest = whatToTestSpidermonkeyTrunk;
michael@0 23 function tryItOut(code)
michael@0 24 {
michael@0 25 var wtt = whatToTest(code.replace(/\n/g, " ").replace(/\r/g, " "));
michael@0 26 var f = new Function(code);
michael@0 27 if (wtt.allowExec && f) {
michael@0 28 rv = tryRunning(f, code);
michael@0 29 }
michael@0 30 }
michael@0 31 function tryRunning(f, code)
michael@0 32 {
michael@0 33 try {
michael@0 34 var rv = f();
michael@0 35 } catch(runError) {}
michael@0 36 }
michael@0 37 var realFunction = Function;
michael@0 38 var realUneval = uneval;
michael@0 39 var realToString = toString;
michael@0 40 var realToSource = toSource;
michael@0 41 function tryEnsureSanity()
michael@0 42 {
michael@0 43 delete Function;
michael@0 44 delete uneval;
michael@0 45 delete toSource;
michael@0 46 delete toString;
michael@0 47 Function = realFunction;
michael@0 48 uneval = realUneval;
michael@0 49 toSource = realToSource;
michael@0 50 toString = realToString;
michael@0 51 }
michael@0 52 for (let iters = 0; iters < 2000; ++iters) {
michael@0 53 count=27745; tryItOut("with({x: (c) = (x2 = [])})false;");
michael@0 54 tryEnsureSanity();
michael@0 55 count=35594; tryItOut("switch(null) { case this.__defineSetter__(\"window\", function () { yield \"\" } ): break; }");
michael@0 56 tryEnsureSanity();
michael@0 57 count=45020; tryItOut("with({}) { (this.__defineGetter__(\"x\", function (y)this)); } ");
michael@0 58 tryEnsureSanity();
michael@0 59 count=45197; tryItOut("M:with((p={}, (p.z = <x/> === '' )()))/*TUUL*/for each (let y in [true, {}, {}, (void 0), true, true, true, (void 0), true, (void 0)]) { return; }");
michael@0 60 tryEnsureSanity();
michael@0 61 gc();
michael@0 62 tryEnsureSanity();
michael@0 63 count=45254; tryItOut("for each (NaN in this);");
michael@0 64 tryEnsureSanity();
michael@0 65 }
michael@0 66
michael@0 67 reportCompare(expect, actual, summary);

mercurial