diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /js/src/tests/test262/built-ins/Date/S15.9.3.1_A5_T6.js | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/built-ins/Date/S15.9.3.1_A5_T6.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Date/S15.9.3.1_A5_T6.js | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Date/S15.9.3.1_A5_T6.js b/js/src/tests/test262/built-ins/Date/S15.9.3.1_A5_T6.js new file mode 100644 index 0000000000..3c60cfe520 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/S15.9.3.1_A5_T6.js @@ -0,0 +1,43 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +info: | + The [[Value]] property of the newly constructed object + is set by following steps: + 8. If Result(1) is not NaN and 0 <= ToInteger(Result(1)) <= 99, Result(8) is + 1900+ToInteger(Result(1)); otherwise, Result(8) is Result(1) + 9. Compute MakeDay(Result(8), Result(2), Result(3)) + 10. Compute MakeTime(Result(4), Result(5), Result(6), Result(7)) + 11. Compute MakeDate(Result(9), Result(10)) + 12. Set the [[Value]] property of the newly constructed object to + TimeClip(UTC(Result(11))) +esid: sec-date-year-month-date-hours-minutes-seconds-ms +description: 7 arguments, (year, month, date, hours, minutes, seconds, ms) +includes: [assertRelativeDateMs.js] +---*/ + +assertRelativeDateMs(new Date(1899, 11, 31, 23, 59, 59, 999), -2208988800001); + +assertRelativeDateMs(new Date(1899, 12, 1, 0, 0, 0, 0), -2208988800000); + +assertRelativeDateMs(new Date(1900, 0, 1, 0, 0, 0, 0), -2208988800000); + +assertRelativeDateMs(new Date(1969, 11, 31, 23, 59, 59, 999), -1); + +assertRelativeDateMs(new Date(1969, 12, 1, 0, 0, 0, 0), 0); + +assertRelativeDateMs(new Date(1970, 0, 1, 0, 0, 0, 0), 0); + +assertRelativeDateMs(new Date(1999, 11, 31, 23, 59, 59, 999), 946684799999); + +assertRelativeDateMs(new Date(1999, 12, 1, 0, 0, 0, 0), 946684800000); + +assertRelativeDateMs(new Date(2000, 0, 1, 0, 0, 0, 0), 946684800000); + +assertRelativeDateMs(new Date(2099, 11, 31, 23, 59, 59, 999), 4102444799999); + +assertRelativeDateMs(new Date(2099, 12, 1, 0, 0, 0, 0), 4102444800000); + +assertRelativeDateMs(new Date(2100, 0, 1, 0, 0, 0, 0), 4102444800000); + +reportCompare(0, 0); |