From 0aaba81f5626a1557b8f420f101262ad7d77ceff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Wed, 30 Apr 2025 14:15:59 +0200 Subject: [PATCH] Remove print calls in sm/Date --- .../sm/Date/UTC-convert-all-arguments.js | 16 +--------------- .../Date/constructor-convert-all-arguments.js | 16 +--------------- .../sm/Date/constructor-one-Date-argument.js | 16 +--------------- .../staging/sm/Date/constructor-one-argument.js | 16 +--------------- test/staging/sm/Date/defaultvalue.js | 15 +-------------- test/staging/sm/Date/equality-to-boolean.js | 12 +----------- test/staging/sm/Date/fractions.js | 14 +------------- test/staging/sm/Date/non-iso.js | 9 +-------- test/staging/sm/Date/prototype-is-not-a-date.js | 7 +------ .../sm/Date/setTime-argument-shortcircuiting.js | 12 +----------- test/staging/sm/Date/timeclip.js | 14 +------------- test/staging/sm/Date/toISOString-01.js | 11 ++--------- test/staging/sm/Date/toJSON-01.js | 17 +---------------- test/staging/sm/Date/toString-generic.js | 7 +------ test/staging/sm/Date/two-digit-years.js | 9 +-------- 15 files changed, 16 insertions(+), 175 deletions(-) diff --git a/test/staging/sm/Date/UTC-convert-all-arguments.js b/test/staging/sm/Date/UTC-convert-all-arguments.js index c2c51b56af..94b093d641 100644 --- a/test/staging/sm/Date/UTC-convert-all-arguments.js +++ b/test/staging/sm/Date/UTC-convert-all-arguments.js @@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + Date.UTC must convert *all* arguments to number, not return NaN early if a non-finite argument is encountered 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) { @@ -69,7 +59,3 @@ var args = for (var i = 0, len = args.length; i < len; i++) expectThrowTypeError(function() { Date.UTC.apply(null, args[i]); }, i); - -/******************************************************************************/ - -print("Tests complete"); diff --git a/test/staging/sm/Date/constructor-convert-all-arguments.js b/test/staging/sm/Date/constructor-convert-all-arguments.js index de4b2655d5..b2b56e1dff 100644 --- a/test/staging/sm/Date/constructor-convert-all-arguments.js +++ b/test/staging/sm/Date/constructor-convert-all-arguments.js @@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + new Date(...) must convert *all* arguments to number, not return NaN early if a non-finite argument is encountered 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) { @@ -69,7 +59,3 @@ var funcs = for (var i = 0, len = funcs.length; i < len; i++) expectThrowTypeError(funcs[i]); - -/******************************************************************************/ - -print("Tests complete"); diff --git a/test/staging/sm/Date/constructor-one-Date-argument.js b/test/staging/sm/Date/constructor-one-Date-argument.js index b37a58e1d6..04b1380464 100644 --- a/test/staging/sm/Date/constructor-one-Date-argument.js +++ b/test/staging/sm/Date/constructor-one-Date-argument.js @@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict 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 ---*/ -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; var d = new Date(new Date(8675309)); @@ -39,7 +29,3 @@ assert.sameValue(d.getTime(), 3141592654); D.prototype.valueOf = () => 525600; d = new Date(new D(3141592654)); assert.sameValue(d.getTime(), 3141592654); - -/******************************************************************************/ - -print("Tests complete"); diff --git a/test/staging/sm/Date/constructor-one-argument.js b/test/staging/sm/Date/constructor-one-argument.js index 75ac93de67..1e07030d6e 100644 --- a/test/staging/sm/Date/constructor-one-argument.js +++ b/test/staging/sm/Date/constructor-one-argument.js @@ -8,24 +8,10 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + new Date(value) should call ToPrimitive on value before testing for string-ness 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(), 1327968000000, "Date constructor passed a String object should parse it"); - -/******************************************************************************/ - -print("Tests complete"); diff --git a/test/staging/sm/Date/defaultvalue.js b/test/staging/sm/Date/defaultvalue.js index ce9fec8736..d6c9edede2 100644 --- a/test/staging/sm/Date/defaultvalue.js +++ b/test/staging/sm/Date/defaultvalue.js @@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + [[DefaultValue]] behavior wrong for Date with overridden valueOf/toString esid: pending ---*/ -var BUGNUMBER = 645464; -var summary = - "[[DefaultValue]] behavior wrong for Date with overridden valueOf/toString"; - -print(BUGNUMBER + ": " + summary); - -/************** - * BEGIN TEST * - **************/ function allTests(Date) { @@ -184,7 +175,3 @@ function allTests(Date) allTests(Date); allTests($262.createRealm().global.Date); - -/******************************************************************************/ - -print("All tests passed!"); diff --git a/test/staging/sm/Date/equality-to-boolean.js b/test/staging/sm/Date/equality-to-boolean.js index 6d6503e556..face3c04e0 100644 --- a/test/staging/sm/Date/equality-to-boolean.js +++ b/test/staging/sm/Date/equality-to-boolean.js @@ -8,15 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + Test for correct implementation of |Date == boolean| and vice versa esid: pending ---*/ -//----------------------------------------------------------------------------- -print("Test for correct implementation of |Date == boolean| and vice versa"); - -/************** - * BEGIN TEST * - **************/ Date.prototype.toString = function() { return 1; }; Date.prototype.valueOf = function() { return 0; }; @@ -40,7 +34,3 @@ assert.sameValue(new Date == false, false); /* == is symmetric. */ assert.sameValue(true == new Date, true); assert.sameValue(false == new Date, false); - -/******************************************************************************/ - -print("Tests complete"); diff --git a/test/staging/sm/Date/fractions.js b/test/staging/sm/Date/fractions.js index 3db2f6376e..8f0a21fc65 100644 --- a/test/staging/sm/Date/fractions.js +++ b/test/staging/sm/Date/fractions.js @@ -8,22 +8,10 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + Fractional days, months, years shouldn't trigger asserts 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).setUTCDate(1.5); new Date(0).setMonth(1.5); - -/******************************************************************************/ - -print("Tests complete"); diff --git a/test/staging/sm/Date/non-iso.js b/test/staging/sm/Date/non-iso.js index f530542a26..94922f0c8d 100644 --- a/test/staging/sm/Date/non-iso.js +++ b/test/staging/sm/Date/non-iso.js @@ -11,6 +11,7 @@ description: | pending esid: pending ---*/ + /* * For the sake of cross compatibility with other implementations we * 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 */ -/************** - * BEGIN TEST * - **************/ - assert.sameValue(new Date("1997-03-08 1:1:1.01").getTime(), new Date("1997-03-08T01:01:01.01").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()); assert.sameValue(new Date("1997-03-08T1:1:1").getTime(), new Date(NaN).getTime()); - -/******************************************************************************/ - -print("Tests complete"); diff --git a/test/staging/sm/Date/prototype-is-not-a-date.js b/test/staging/sm/Date/prototype-is-not-a-date.js index eb60b89da9..904a5dbf04 100644 --- a/test/staging/sm/Date/prototype-is-not-a-date.js +++ b/test/staging/sm/Date/prototype-is-not-a-date.js @@ -8,14 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + Date.prototype isn't an instance of Date 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.__proto__, Object.prototype); - diff --git a/test/staging/sm/Date/setTime-argument-shortcircuiting.js b/test/staging/sm/Date/setTime-argument-shortcircuiting.js index a047a02638..5057c1d295 100644 --- a/test/staging/sm/Date/setTime-argument-shortcircuiting.js +++ b/test/staging/sm/Date/setTime-argument-shortcircuiting.js @@ -8,15 +8,10 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + Test for correct short-circuiting implementation of Date.set methods esid: pending ---*/ -//----------------------------------------------------------------------------- -print("Test for correct short-circuiting implementation of Date.set methods"); -/************** - * BEGIN TEST * - **************/ var global = 0; var date; @@ -147,8 +142,3 @@ assert.sameValue(global, 45); date = new Date(NaN).setYear({valueOf:function(){global = 46}}); assert.sameValue(global, 46); - - -/******************************************************************************/ - -print("Tests complete"); diff --git a/test/staging/sm/Date/timeclip.js b/test/staging/sm/Date/timeclip.js index f08f148b11..f6b2c944c9 100644 --- a/test/staging/sm/Date/timeclip.js +++ b/test/staging/sm/Date/timeclip.js @@ -8,17 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + TimeClip behavior for very large numbers 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; } @@ -41,7 +33,3 @@ for (var i = 0, len = times.length; i < len; i++) assert.sameValue(d.getTime(), NaN); assert.sameValue(d.valueOf(), NaN); } - -/******************************************************************************/ - -print("Tests complete"); diff --git a/test/staging/sm/Date/toISOString-01.js b/test/staging/sm/Date/toISOString-01.js index fa3cc286c0..875a63a452 100644 --- a/test/staging/sm/Date/toISOString-01.js +++ b/test/staging/sm/Date/toISOString-01.js @@ -6,18 +6,13 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + Date.prototype.toISOString returns an invalid ISO-8601 string esid: pending ---*/ + /* Any copyright is dedicated to the Public Domain. * 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) { return new Date(t).toISOString(); } @@ -58,5 +53,3 @@ assert.sameValue(minDateExtended, -8.64e15); assert.throws(RangeError, () => iso(minDateExtended - 1)); assert.sameValue(iso(minDateExtended ), "-271821-04-20T00:00:00.000Z"); assert.sameValue(iso(minDateExtended + 1), "-271821-04-20T00:00:00.001Z"); - - diff --git a/test/staging/sm/Date/toJSON-01.js b/test/staging/sm/Date/toJSON-01.js index 31d705adb9..11c6bb7086 100644 --- a/test/staging/sm/Date/toJSON-01.js +++ b/test/staging/sm/Date/toJSON-01.js @@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + Date.prototype.toJSON isn't to spec 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; @@ -238,8 +228,3 @@ var obj = {}; called = false; assert.sameValue(dateToJSON.call(o), obj, "should have gotten obj back"); assert.sameValue(called, true); - - -/******************************************************************************/ - -print("All tests passed!"); diff --git a/test/staging/sm/Date/toString-generic.js b/test/staging/sm/Date/toString-generic.js index 5da7e1cfdd..02e0ba4cc8 100644 --- a/test/staging/sm/Date/toString-generic.js +++ b/test/staging/sm/Date/toString-generic.js @@ -6,19 +6,14 @@ includes: [sm/non262.js, sm/non262-shell.js] flags: - noStrict description: | - pending + Date.prototype.toString is a generic function 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). -print(BUGNUMBER + ": " + summary); - for (var thisValue of [{}, [], /foo/, Date.prototype, new Proxy(new Date(), {})]) assert.throws(TypeError, () => Date.prototype.toString.call(thisValue)); for (var prim of [null, undefined, 0, 1.2, true, false, "foo", Symbol.iterator]) assert.throws(TypeError, () => Date.prototype.toString.call(prim)); - diff --git a/test/staging/sm/Date/two-digit-years.js b/test/staging/sm/Date/two-digit-years.js index 31209e7587..b3a179503f 100644 --- a/test/staging/sm/Date/two-digit-years.js +++ b/test/staging/sm/Date/two-digit-years.js @@ -11,16 +11,13 @@ description: | pending esid: pending ---*/ + /* * For the sake of cross compatibility with other implementations we * implement date parsing heuristics which support single and double * digit years. See bug: 1265136 */ -/************** - * BEGIN TEST * - **************/ - for (let year of Array(100).keys()) { for (let month of Array(12).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 0 0").getTime(), new Date(NaN).getTime()); - -/******************************************************************************/ - -print("Tests complete");