Follow-up r103915. The @fixme of r103865 was wrong.
authorPlatonides <platonides@users.mediawiki.org>
Tue, 22 Nov 2011 17:48:32 +0000 (17:48 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Tue, 22 Nov 2011 17:48:32 +0000 (17:48 +0000)
It is apparently legal to have a decimal point without after it,
eg. var a = 5.
Not for hexadecimal numbers.

includes/libs/JavaScriptMinifier.php

index 78c8030..94e89d3 100644 (file)
@@ -504,11 +504,7 @@ class JavaScriptMinifier {
                                        if ( $decimal > 1 ) {
                                                return self::parseError($s, $end, 'The number has several decimal points' );
                                        }
-                                       $len = strspn( $s, '0123456789', $end );
-                                       if ( !$len ) {
-                                               return self::parseError($s, $pos, 'No numbers after decimal point' );
-                                       }
-                                       $end += $len + 1;
+                                       $end += strspn( $s, '0123456789', $end ) + 1;
                                }
                                $exponent = strspn( $s, 'eE', $end );
                                if( $exponent ) {