js/src/jit-test/tests/ion/bug732850.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.

     1 var gTestcases = new Array();
     2 var gTc = gTestcases.length;
     3 function TestCase(n, d, e, a) {
     4     this.passed = getTestCaseResult(e, a);
     5     gTestcases[gTc++] = this;
     6 }
     7 function getTestCaseResult(expected, actual) {
     8     if (typeof expected != 'number')
     9         return actual == expected;
    10     return Math.abs(actual - expected) <= 1E-10;
    11 }
    12 function test() {
    13     for ( gTc=0; gTc < gTestcases.length; gTc++ ) {
    14         gTestcases[gTc].passed = writeTestCaseResult(gTestcases[gTc].description +" = "+ gTestcases[gTc].actual);
    15     }
    16     function writeTestCaseResult( expect, actual, string ) {
    17         var passed = getTestCaseResult( expect, actual );
    18     }
    19 }
    20 var SECTION = "15.4.2.1-1";
    21 new TestCase( SECTION, eval("var arr = (new Array(1,2)); arr[0]") );
    22 new TestCase( SECTION, "var arr = (new Array(1,2)); String(arr)", "1,2", (this.abstract++));
    23 test();
    24 new TestCase( SECTION, "VAR1 = NaN; VAR2=1; VAR1 -= VAR2", Number.NaN, eval("VAR1 = Number.NaN; VAR2=1; VAR1 -= VAR2"));

mercurial