browser: derive support from surrounding versions
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 15 Dec 2010 23:34:25 +0000 (00:34 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 15 Dec 2010 23:44:33 +0000 (00:44 +0100)
Assume a version with undefined support value will be the same as either its
predecessor or unsupported successor.

browser.plp

index 863f806..7eaa669 100644 (file)
@@ -271,8 +271,10 @@ sub saybrowsercols {
                my $compare = (
                        !defined $ver ? undef :      # last column if nameless
                        ref $data ne 'HASH' ? 'u' :  # unsupported if no support hash
-                       $data->{$ver}                # known
-                       || 'u'                       # unsure unless oldest is unsupported
+                       $data->{$ver} // $prev       # known or inherit from predecessor
+                       // (grep { defined } @{$data}{ @{ $versions{$browser} } })[0]
+                          ~~ 'n' && 'n'             # first known version is unsupported
+                       || 'u'                       # unsure
                );
                unless (!defined $prev or $prev ~~ $compare) {
                        my $usage = sum(map { $canihas->{$browser}->{$_} } @span);