Skip to content

Commit 10c0b11

Browse files
justingrantptomato
authored andcommitted
Remove workarounds for V8 bugs now fixed in Node14
1 parent c4d10b4 commit 10c0b11

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

test/intl.mjs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,11 @@ describe('Intl', () => {
360360
'gregory: 1/1/1\n' +
361361
'hebrew: 18 Tevet 3761\n' +
362362
'indian: 10/11/-78 Saka\n' +
363-
'islamic: -7/20/-639 AH\n' +
363+
'islamic: 5/20/-640 AH\n' +
364364
'islamic-umalqura: 5/18/-640 AH\n' +
365365
'islamic-tbla: 5/19/-640 AH\n' +
366366
'islamic-civil: 5/18/-640 AH\n' +
367-
'islamic-rgsa: -7/20/-639 AH\n' +
367+
'islamic-rgsa: 5/20/-640 AH\n' +
368368
'islamicc: 5/18/-640 AH\n' +
369369
'japanese: 1/3/-643 Taika (645–650)\n' +
370370
'persian: 10/11/-621 AP\n' +
@@ -432,17 +432,17 @@ describe('Intl', () => {
432432
year2000: { year: 1921, month: 10, day: 11, era: 'saka' },
433433
// with() fails due to https://bugs.chromium.org/p/v8/issues/detail?id=10529
434434
// from() succeeds because the bug only gets triggered before 1/1/1 ISO.
435-
// Fixed in Node 15
435+
// Fixed in later versions of Node 14/15/16
436436
year1: {
437-
with: { nodeBefore15: RangeError, year: -78, month: 10, day: 11, era: 'saka' },
437+
with: { node12: RangeError, year: -78, month: 10, day: 11, era: 'saka' },
438438
from: { year: -78, month: 10, day: 11, era: 'saka' }
439439
}
440440
},
441441
// Older islamic dates will fail due to https://bugs.chromium.org/p/v8/issues/detail?id=10527
442-
// Fixed in Node 15
442+
// Fixed in later versions of Node 14/15/16
443443
islamic: {
444444
year2000: { year: 1420, month: 9, day: 25, era: 'ah' },
445-
year1: { nodeBefore15: RangeError, year: -640, month: 5, day: 20, era: 'ah' }
445+
year1: { node12: RangeError, year: -640, month: 5, day: 20, era: 'ah' }
446446
},
447447
'islamic-umalqura': {
448448
year2000: { year: 1420, month: 9, day: 24, era: 'ah' },
@@ -458,7 +458,7 @@ describe('Intl', () => {
458458
},
459459
'islamic-rgsa': {
460460
year2000: { year: 1420, month: 9, day: 25, era: 'ah' },
461-
year1: { nodeBefore15: RangeError, year: -640, month: 5, day: 20, era: 'ah' }
461+
year1: { node12: RangeError, year: -640, month: 5, day: 20, era: 'ah' }
462462
},
463463
islamicc: {
464464
year2000: { year: 1420, month: 9, day: 24, era: 'ah' },
@@ -504,8 +504,7 @@ describe('Intl', () => {
504504
};
505505
const fromValues = getValues('from');
506506
const fromErrorExpected =
507-
fromValues === RangeError ||
508-
((nodeVersion === '14' || nodeVersion === '12') && fromValues.nodeBefore15 === RangeError);
507+
fromValues === RangeError || (nodeVersion === '12' && fromValues.node12 === RangeError);
509508
itOrSkip(id)(`from: ${id} ${name} ${fromErrorExpected ? ' (throws)' : ''}`, () => {
510509
const now = globalThis.performance ? globalThis.performance.now() : Date.now();
511510
const values = fromValues;
@@ -600,8 +599,7 @@ describe('Intl', () => {
600599
});
601600
const withValues = getValues('with');
602601
const withErrorExpected =
603-
withValues === RangeError ||
604-
((nodeVersion === '14' || nodeVersion === '12') && withValues.nodeBefore15 === RangeError);
602+
withValues === RangeError || (nodeVersion === '12' && withValues.node12 === RangeError);
605603
itOrSkip(id)(`with: ${id} ${name} ${withErrorExpected ? ' (throws)' : ''}`, () => {
606604
const now = globalThis.performance ? globalThis.performance.now() : Date.now();
607605
const inCal = date.withCalendar(id);

0 commit comments

Comments
 (0)