browser: support new data version
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 5 Dec 2010 18:42:04 +0000 (19:42 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 6 Dec 2010 00:04:46 +0000 (01:04 +0100)
browser.plp

index 2de8458..f385042 100644 (file)
@@ -51,6 +51,7 @@ my %CSTATUS = (
        cr    => 'l5', # candidate
        pr    => 'l5', # proposed
        rec   => 'l6', # recommendation
+       other => 'l6', # non-w3
        ietf  => 'l6', # standard
 );
 my %versions;
@@ -66,11 +67,12 @@ $canihas ||= {
        map {
                $_ => +{
                        map {
-                               ($_->[4] =>  0 ), # future
-                               ($_->[3] =>  .5), # next
-                               ($_->[0] =>  5 ), # past
-                               ($_->[1] => 10 ), # previous
-                               ($_->[2] => 30 ), # current
+                               my $zero = $#$_ - 2;  # baseline index
+                               ($_->[$zero - 2] =>  .5), # past
+                               ($_->[$zero - 1] => 10 ), # previous
+                               ($_->[$zero + 2] =>  0 ), # future
+                               ($_->[$zero + 1] =>  .5), # next
+                               ($_->[$zero    ] => 30 ), # current
                        } $caniuse->{agents}->{$_}->{versions}
                }
        } @browsers