Remove print calls in sm/Date

This commit is contained in:
André Bargull 2025-04-30 14:15:59 +02:00 committed by Philip Chimento
parent fc730403e7
commit 0aaba81f56
15 changed files with 16 additions and 175 deletions

View File

@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending Date.UTC must convert *all* arguments to number, not return NaN early if a non-finite argument is encountered
esid: pending esid: pending
---*/ ---*/
var BUGNUMBER = 1160356;
var summary =
"Date.UTC must convert *all* arguments to number, not return NaN early if " +
"a non-finite argument is encountered";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
function expectThrowTypeError(f, i) function expectThrowTypeError(f, i)
{ {
@ -69,7 +59,3 @@ var args =
for (var i = 0, len = args.length; i < len; i++) for (var i = 0, len = args.length; i < len; i++)
expectThrowTypeError(function() { Date.UTC.apply(null, args[i]); }, i); expectThrowTypeError(function() { Date.UTC.apply(null, args[i]); }, i);
/******************************************************************************/
print("Tests complete");

View File

@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending new Date(...) must convert *all* arguments to number, not return NaN early if a non-finite argument is encountered
esid: pending esid: pending
---*/ ---*/
var BUGNUMBER = 1160356;
var summary =
"new Date(...) must convert *all* arguments to number, not return NaN " +
"early if a non-finite argument is encountered";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
function expectThrowTypeError(f, i) function expectThrowTypeError(f, i)
{ {
@ -69,7 +59,3 @@ var funcs =
for (var i = 0, len = funcs.length; i < len; i++) for (var i = 0, len = funcs.length; i < len; i++)
expectThrowTypeError(funcs[i]); expectThrowTypeError(funcs[i]);
/******************************************************************************/
print("Tests complete");

View File

@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending Passing a Date object to |new Date()| should copy it, not convert it to a primitive and create it from that.
esid: pending esid: pending
---*/ ---*/
var BUGNUMBER = 1187233;
var summary =
"Passing a Date object to |new Date()| should copy it, not convert it to " +
"a primitive and create it from that.";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
Date.prototype.toString = Date.prototype.valueOf = null; Date.prototype.toString = Date.prototype.valueOf = null;
var d = new Date(new Date(8675309)); var d = new Date(new Date(8675309));
@ -39,7 +29,3 @@ assert.sameValue(d.getTime(), 3141592654);
D.prototype.valueOf = () => 525600; D.prototype.valueOf = () => 525600;
d = new Date(new D(3141592654)); d = new Date(new D(3141592654));
assert.sameValue(d.getTime(), 3141592654); assert.sameValue(d.getTime(), 3141592654);
/******************************************************************************/
print("Tests complete");

View File

@ -8,24 +8,10 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending new Date(value) should call ToPrimitive on value before testing for string-ness
esid: pending esid: pending
---*/ ---*/
var BUGNUMBER = 738511;
var summary =
"new Date(value) should call ToPrimitive on value before testing for " +
"string-ness";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
assert.sameValue(new Date(new String("2012-01-31T00:00:00.000Z")).valueOf(), assert.sameValue(new Date(new String("2012-01-31T00:00:00.000Z")).valueOf(),
1327968000000, 1327968000000,
"Date constructor passed a String object should parse it"); "Date constructor passed a String object should parse it");
/******************************************************************************/
print("Tests complete");

View File

@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending [[DefaultValue]] behavior wrong for Date with overridden valueOf/toString
esid: pending esid: pending
---*/ ---*/
var BUGNUMBER = 645464;
var summary =
"[[DefaultValue]] behavior wrong for Date with overridden valueOf/toString";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
function allTests(Date) function allTests(Date)
{ {
@ -184,7 +175,3 @@ function allTests(Date)
allTests(Date); allTests(Date);
allTests($262.createRealm().global.Date); allTests($262.createRealm().global.Date);
/******************************************************************************/
print("All tests passed!");

View File

@ -8,15 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending Test for correct implementation of |Date == boolean| and vice versa
esid: pending esid: pending
---*/ ---*/
//-----------------------------------------------------------------------------
print("Test for correct implementation of |Date == boolean| and vice versa");
/**************
* BEGIN TEST *
**************/
Date.prototype.toString = function() { return 1; }; Date.prototype.toString = function() { return 1; };
Date.prototype.valueOf = function() { return 0; }; Date.prototype.valueOf = function() { return 0; };
@ -40,7 +34,3 @@ assert.sameValue(new Date == false, false);
/* == is symmetric. */ /* == is symmetric. */
assert.sameValue(true == new Date, true); assert.sameValue(true == new Date, true);
assert.sameValue(false == new Date, false); assert.sameValue(false == new Date, false);
/******************************************************************************/
print("Tests complete");

View File

@ -8,22 +8,10 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending Fractional days, months, years shouldn't trigger asserts
esid: pending esid: pending
---*/ ---*/
var BUGNUMBER = 771946;
var summary = "Fractional days, months, years shouldn't trigger asserts";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
new Date(0).setFullYear(1.5); new Date(0).setFullYear(1.5);
new Date(0).setUTCDate(1.5); new Date(0).setUTCDate(1.5);
new Date(0).setMonth(1.5); new Date(0).setMonth(1.5);
/******************************************************************************/
print("Tests complete");

View File

@ -11,6 +11,7 @@ description: |
pending pending
esid: pending esid: pending
---*/ ---*/
/* /*
* For the sake of cross compatibility with other implementations we * For the sake of cross compatibility with other implementations we
* follow the W3C "NOTE-datetime" specification when parsing dates of * follow the W3C "NOTE-datetime" specification when parsing dates of
@ -20,10 +21,6 @@ esid: pending
* "1997-3-8 1:1:1" will parse successfully. See bug: 1203298 * "1997-3-8 1:1:1" will parse successfully. See bug: 1203298
*/ */
/**************
* BEGIN TEST *
**************/
assert.sameValue(new Date("1997-03-08 1:1:1.01").getTime(), assert.sameValue(new Date("1997-03-08 1:1:1.01").getTime(),
new Date("1997-03-08T01:01:01.01").getTime()); new Date("1997-03-08T01:01:01.01").getTime());
assert.sameValue(new Date("1997-03-08 11:19:20").getTime(), assert.sameValue(new Date("1997-03-08 11:19:20").getTime(),
@ -70,7 +67,3 @@ assert.sameValue(new Date("1997-03-08T1:1:01").getTime(),
new Date(NaN).getTime()); new Date(NaN).getTime());
assert.sameValue(new Date("1997-03-08T1:1:1").getTime(), assert.sameValue(new Date("1997-03-08T1:1:1").getTime(),
new Date(NaN).getTime()); new Date(NaN).getTime());
/******************************************************************************/
print("Tests complete");

View File

@ -8,14 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending Date.prototype isn't an instance of Date
esid: pending esid: pending
---*/ ---*/
var BUGNUMBER = 861219;
var summary = "Date.prototype isn't an instance of Date";
print(BUGNUMBER + ": " + summary);
assert.sameValue(Date.prototype instanceof Date, false); assert.sameValue(Date.prototype instanceof Date, false);
assert.sameValue(Date.prototype.__proto__, Object.prototype); assert.sameValue(Date.prototype.__proto__, Object.prototype);

View File

@ -8,15 +8,10 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending Test for correct short-circuiting implementation of Date.set methods
esid: pending esid: pending
---*/ ---*/
//-----------------------------------------------------------------------------
print("Test for correct short-circuiting implementation of Date.set methods");
/**************
* BEGIN TEST *
**************/
var global = 0; var global = 0;
var date; var date;
@ -147,8 +142,3 @@ assert.sameValue(global, 45);
date = new Date(NaN).setYear({valueOf:function(){global = 46}}); date = new Date(NaN).setYear({valueOf:function(){global = 46}});
assert.sameValue(global, 46); assert.sameValue(global, 46);
/******************************************************************************/
print("Tests complete");

View File

@ -8,17 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending TimeClip behavior for very large numbers
esid: pending esid: pending
---*/ ---*/
var BUGNUMBER = 747197;
var summary = "TimeClip behavior for very large numbers";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
function addToLimit(n) { return 8.64e15 + n; } function addToLimit(n) { return 8.64e15 + n; }
@ -41,7 +33,3 @@ for (var i = 0, len = times.length; i < len; i++)
assert.sameValue(d.getTime(), NaN); assert.sameValue(d.getTime(), NaN);
assert.sameValue(d.valueOf(), NaN); assert.sameValue(d.valueOf(), NaN);
} }
/******************************************************************************/
print("Tests complete");

View File

@ -6,18 +6,13 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending Date.prototype.toISOString returns an invalid ISO-8601 string
esid: pending esid: pending
---*/ ---*/
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
//-----------------------------------------------------------------------------
var BUGNUMBER = 730831;
var summary = 'Date.prototype.toISOString returns an invalid ISO-8601 string';
print(BUGNUMBER + ": " + summary);
function iso(t) { function iso(t) {
return new Date(t).toISOString(); return new Date(t).toISOString();
} }
@ -58,5 +53,3 @@ assert.sameValue(minDateExtended, -8.64e15);
assert.throws(RangeError, () => iso(minDateExtended - 1)); assert.throws(RangeError, () => iso(minDateExtended - 1));
assert.sameValue(iso(minDateExtended ), "-271821-04-20T00:00:00.000Z"); assert.sameValue(iso(minDateExtended ), "-271821-04-20T00:00:00.000Z");
assert.sameValue(iso(minDateExtended + 1), "-271821-04-20T00:00:00.001Z"); assert.sameValue(iso(minDateExtended + 1), "-271821-04-20T00:00:00.001Z");

View File

@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending Date.prototype.toJSON isn't to spec
esid: pending esid: pending
---*/ ---*/
var gTestfile = 'toJSON-01.js';
//-----------------------------------------------------------------------------
var BUGNUMBER = 584811;
var summary = "Date.prototype.toJSON isn't to spec";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
var called; var called;
@ -238,8 +228,3 @@ var obj = {};
called = false; called = false;
assert.sameValue(dateToJSON.call(o), obj, "should have gotten obj back"); assert.sameValue(dateToJSON.call(o), obj, "should have gotten obj back");
assert.sameValue(called, true); assert.sameValue(called, true);
/******************************************************************************/
print("All tests passed!");

View File

@ -6,19 +6,14 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags: flags:
- noStrict - noStrict
description: | description: |
pending Date.prototype.toString is a generic function
esid: pending esid: pending
---*/ ---*/
var BUGNUMBER = 861219;
var summary = 'Date.prototype.toString is a generic function';
// Revised in ECMA 2018, Date.prototype.toString is no longer generic (bug 1381433). // Revised in ECMA 2018, Date.prototype.toString is no longer generic (bug 1381433).
print(BUGNUMBER + ": " + summary);
for (var thisValue of [{}, [], /foo/, Date.prototype, new Proxy(new Date(), {})]) for (var thisValue of [{}, [], /foo/, Date.prototype, new Proxy(new Date(), {})])
assert.throws(TypeError, () => Date.prototype.toString.call(thisValue)); assert.throws(TypeError, () => Date.prototype.toString.call(thisValue));
for (var prim of [null, undefined, 0, 1.2, true, false, "foo", Symbol.iterator]) for (var prim of [null, undefined, 0, 1.2, true, false, "foo", Symbol.iterator])
assert.throws(TypeError, () => Date.prototype.toString.call(prim)); assert.throws(TypeError, () => Date.prototype.toString.call(prim));

View File

@ -11,16 +11,13 @@ description: |
pending pending
esid: pending esid: pending
---*/ ---*/
/* /*
* For the sake of cross compatibility with other implementations we * For the sake of cross compatibility with other implementations we
* implement date parsing heuristics which support single and double * implement date parsing heuristics which support single and double
* digit years. See bug: 1265136 * digit years. See bug: 1265136
*/ */
/**************
* BEGIN TEST *
**************/
for (let year of Array(100).keys()) { for (let year of Array(100).keys()) {
for (let month of Array(12).keys()) { for (let month of Array(12).keys()) {
for (let day of Array(31).keys()) { for (let day of Array(31).keys()) {
@ -70,7 +67,3 @@ for (let year of Array(1000).keys()) {
assert.sameValue(new Date("may 1999 1999").getTime(), new Date(NaN).getTime()); assert.sameValue(new Date("may 1999 1999").getTime(), new Date(NaN).getTime());
assert.sameValue(new Date("may 0 0").getTime(), new Date(NaN).getTime()); assert.sameValue(new Date("may 0 0").getTime(), new Date(NaN).getTime());
/******************************************************************************/
print("Tests complete");