Skip to content

Commit 7e10cde

Browse files
maltheaduh95
andcommitted
test_runner: use internal date check function
This fixes an issue where a value could be `instanceof Date` without actually being a native date. Co-authored-by: Antoine du Hamel <[email protected]>
1 parent 9323496 commit 7e10cde

File tree

1 file changed

+2
-3
lines changed
  • lib/internal/test_runner/reporter

1 file changed

+2
-3
lines changed

lib/internal/test_runner/reporter/tap.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const {
33
ArrayPrototypeForEach,
44
ArrayPrototypeJoin,
55
ArrayPrototypePush,
6-
Date,
76
ObjectEntries,
87
RegExpPrototypeSymbolReplace,
98
RegExpPrototypeSymbolSplit,
@@ -164,9 +163,9 @@ function jsToYaml(indent, name, value, seen) {
164163

165164
if (name != null) {
166165
result += prefix;
167-
if (value instanceof Date) {
166+
if (internalBindings('types').isDate(value)) {
168167
// YAML uses the ISO-8601 standard to express dates.
169-
result += ' ' + value.toISOString();
168+
result += ' ' + DatePrototypeToISOString(value);
170169
}
171170
result += '\n';
172171
propsIndent += ' ';

0 commit comments

Comments
 (0)