Sat, 03 Jan 2015 20:18:00 +0100
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 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /**
8 File Name: 15.9.3.8.js
9 ECMA Section: 15.9.3.8 The Date Constructor
10 new Date( value )
11 Description: The [[Prototype]] property of the newly constructed
12 object is set to the original Date prototype object,
13 the one that is the initial valiue of Date.prototype.
15 The [[Class]] property of the newly constructed object is
16 set to "Date".
18 The [[Value]] property of the newly constructed object is
19 set as follows:
21 1. Call ToPrimitive(value)
22 2. If Type( Result(1) ) is String, then go to step 5.
23 3. Let V be ToNumber( Result(1) ).
24 4. Set the [[Value]] property of the newly constructed
25 object to TimeClip(V) and return.
26 5. Parse Result(1) as a date, in exactly the same manner
27 as for the parse method. Let V be the time value for
28 this date.
29 6. Go to step 4.
31 Author: christine@netscape.com
32 Date: 28 october 1997
33 Version: 9706
35 */
37 var VERSION = "ECMA_1";
38 startTest();
39 var SECTION = "15.9.3.8";
40 var TYPEOF = "object";
42 var TIME = 0;
43 var UTC_YEAR = 1;
44 var UTC_MONTH = 2;
45 var UTC_DATE = 3;
46 var UTC_DAY = 4;
47 var UTC_HOURS = 5;
48 var UTC_MINUTES = 6;
49 var UTC_SECONDS = 7;
50 var UTC_MS = 8;
52 var YEAR = 9;
53 var MONTH = 10;
54 var DATE = 11;
55 var DAY = 12;
56 var HOURS = 13;
57 var MINUTES = 14;
58 var SECONDS = 15;
59 var MS = 16;
62 // for TCMS, the gTestcases array must be global.
63 var gTc= 0;
64 var TITLE = "Date constructor: new Date( value )";
65 var SECTION = "15.9.3.8";
66 var VERSION = "ECMA_1";
67 startTest();
69 writeHeaderToLog( SECTION +" " + TITLE );
71 // all the "ResultArrays" below are hard-coded to Pacific Standard Time values -
72 var TZ_ADJUST = -TZ_PST * msPerHour;
75 // Dates around 1900
77 var PST_1900 = TIME_1900 + 8*msPerHour;
79 addNewTestCase( new Date( TIME_1900 ),
80 "new Date("+TIME_1900+")",
81 [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
83 addNewTestCase( new Date(PST_1900),
84 "new Date("+PST_1900+")",
85 [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
87 addNewTestCase( new Date( (new Date(TIME_1900)).toString() ),
88 "new Date(\""+(new Date(TIME_1900)).toString()+"\")",
89 [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
91 addNewTestCase( new Date( (new Date(PST_1900)).toString() ),
92 "new Date(\""+(new Date(PST_1900 )).toString()+"\")",
93 [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
95 addNewTestCase( new Date( (new Date(TIME_1900)).toUTCString() ),
96 "new Date(\""+(new Date(TIME_1900)).toUTCString()+"\")",
97 [TIME_1900,1900,0,1,1,0,0,0,0,1899,11,31,0,16,0,0,0] );
99 addNewTestCase( new Date( (new Date(PST_1900)).toUTCString() ),
100 "new Date(\""+(new Date(PST_1900 )).toUTCString()+"\")",
101 [ PST_1900,1900,0,1,1,8,0,0,0,1900,0,1,1,0,0,0,0] );
103 test();
105 function addNewTestCase( DateCase, DateString, ResultArray ) {
106 //adjust hard-coded ResultArray for tester's timezone instead of PST
107 adjustResultArray(ResultArray, 'msMode');
109 new TestCase( SECTION, DateString+".getTime()", ResultArray[TIME], DateCase.getTime() );
110 new TestCase( SECTION, DateString+".valueOf()", ResultArray[TIME], DateCase.valueOf() );
111 new TestCase( SECTION, DateString+".getUTCFullYear()", ResultArray[UTC_YEAR], DateCase.getUTCFullYear() );
112 new TestCase( SECTION, DateString+".getUTCMonth()", ResultArray[UTC_MONTH], DateCase.getUTCMonth() );
113 new TestCase( SECTION, DateString+".getUTCDate()", ResultArray[UTC_DATE], DateCase.getUTCDate() );
114 new TestCase( SECTION, DateString+".getUTCDay()", ResultArray[UTC_DAY], DateCase.getUTCDay() );
115 new TestCase( SECTION, DateString+".getUTCHours()", ResultArray[UTC_HOURS], DateCase.getUTCHours() );
116 new TestCase( SECTION, DateString+".getUTCMinutes()", ResultArray[UTC_MINUTES],DateCase.getUTCMinutes() );
117 new TestCase( SECTION, DateString+".getUTCSeconds()", ResultArray[UTC_SECONDS],DateCase.getUTCSeconds() );
118 new TestCase( SECTION, DateString+".getUTCMilliseconds()", ResultArray[UTC_MS], DateCase.getUTCMilliseconds() );
119 new TestCase( SECTION, DateString+".getFullYear()", ResultArray[YEAR], DateCase.getFullYear() );
120 new TestCase( SECTION, DateString+".getMonth()", ResultArray[MONTH], DateCase.getMonth() );
121 new TestCase( SECTION, DateString+".getDate()", ResultArray[DATE], DateCase.getDate() );
122 new TestCase( SECTION, DateString+".getDay()", ResultArray[DAY], DateCase.getDay() );
123 new TestCase( SECTION, DateString+".getHours()", ResultArray[HOURS], DateCase.getHours() );
124 new TestCase( SECTION, DateString+".getMinutes()", ResultArray[MINUTES], DateCase.getMinutes() );
125 new TestCase( SECTION, DateString+".getSeconds()", ResultArray[SECONDS], DateCase.getSeconds() );
126 new TestCase( SECTION, DateString+".getMilliseconds()", ResultArray[MS], DateCase.getMilliseconds() );
127 }