tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

S15.9.3.1_A6_T1.js (1675B)


      1 // Copyright 2009 the Sputnik authors.  All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 info: |
      6    The [[Value]] property of the newly constructed object
      7    with supplied "undefined" argument should be NaN
      8 esid: sec-date-year-month-date-hours-minutes-seconds-ms
      9 description: 2 arguments, (year, month)
     10 ---*/
     11 
     12 function DateValue(year, month, date, hours, minutes, seconds, ms) {
     13  return new Date(year, month, date, hours, minutes, seconds, ms).valueOf();
     14 }
     15 
     16 var x;
     17 x = DateValue(1899, 11);
     18 assert.sameValue(x, NaN, 'The value of x is expected to equal NaN');
     19 
     20 x = DateValue(1899, 12);
     21 assert.sameValue(x, NaN, 'The value of x is expected to equal NaN');
     22 
     23 x = DateValue(1900, 0);
     24 assert.sameValue(x, NaN, 'The value of x is expected to equal NaN');
     25 
     26 x = DateValue(1969, 11);
     27 assert.sameValue(x, NaN, 'The value of x is expected to equal NaN');
     28 
     29 x = DateValue(1969, 12);
     30 assert.sameValue(x, NaN, 'The value of x is expected to equal NaN');
     31 
     32 x = DateValue(1970, 0);
     33 assert.sameValue(x, NaN, 'The value of x is expected to equal NaN');
     34 
     35 x = DateValue(1999, 11);
     36 assert.sameValue(x, NaN, 'The value of x is expected to equal NaN');
     37 
     38 x = DateValue(1999, 12);
     39 assert.sameValue(x, NaN, 'The value of x is expected to equal NaN');
     40 
     41 x = DateValue(2000, 0);
     42 assert.sameValue(x, NaN, 'The value of x is expected to equal NaN');
     43 
     44 x = DateValue(2099, 11);
     45 assert.sameValue(x, NaN, 'The value of x is expected to equal NaN');
     46 
     47 x = DateValue(2099, 12);
     48 assert.sameValue(x, NaN, 'The value of x is expected to equal NaN');
     49 
     50 x = DateValue(2100, 0);
     51 assert.sameValue(x, NaN, 'The value of x is expected to equal NaN');
     52 
     53 reportCompare(0, 0);