From 5acb117e44caa64c43ee8cd4cb4b3dbafe4b9c45 Mon Sep 17 00:00:00 2001 From: Sebastian Zartner Date: Thu, 6 Jan 2022 19:19:41 +0100 Subject: [PATCH] Replaced optional chaining operator by legacy JS --- csstest.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/csstest.js b/csstest.js index b27731f..2010d43 100644 --- a/csstest.js +++ b/csstest.js @@ -429,19 +429,19 @@ function runTests(filter = '') { for (let spec in Specs) { // Filter list of specifications - if (filter === 'stable' && Specs[spec]?.status?.stability !== 'stable') { + if (filter === 'stable' && Specs[spec].status && Specs[spec].status.stability !== 'stable') { continue; - } else if (filter === 'experimental' && Specs[spec]?.status?.stability === 'stable') { + } else if (filter === 'experimental' && Specs[spec].status && Specs[spec].status.stability === 'stable') { continue; } else if (Number(filter) > 0) { - if (Specs[spec]?.status?.['first-snapshot'] === undefined) { + if (!Specs[spec].status || Specs[spec].status['first-snapshot'] === undefined) { continue; } const snapshot = Number(filter); if ( Specs[spec].status['first-snapshot'] > snapshot || - Specs[spec]?.status?.['last-snapshot'] < snapshot + (Specs[spec].status && Specs[spec].status['last-snapshot'] < snapshot) ) { continue; }