r103940 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103939‎ | r103940 | r103941 >
Date:18:56, 22 November 2011
Author:platonides
Status:ok
Tags:
Comment:
Final fixup to r103910 and follow-ups.
Reverts r103931 test change.
Modified paths:
  • /trunk/phase3/includes/libs/JavaScriptMinifier.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/libs/JavaScriptMinifierTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/libs/JavaScriptMinifierTest.php
@@ -121,7 +121,7 @@
122122 $suffix = ',shortVarName=0;';
123123
124124 $input = $prefix . $num . $suffix;
125 - $expected = $prefix . $num . "\n" . $suffix;
 125+ $expected = $prefix . "\n" . $num . $suffix;
126126
127127 $minified = JavaScriptMinifier::minify( $input );
128128
Index: trunk/phase3/includes/libs/JavaScriptMinifier.php
@@ -504,7 +504,7 @@
505505 if ( $decimal > 2 ) {
506506 return self::parseError($s, $end, 'The number has too many decimal points' );
507507 }
508 - $end += strspn( $s, '0123456789', $end ) + 1;
 508+ $end += strspn( $s, '0123456789', $end + 1 ) + $decimal;
509509 }
510510 $exponent = strspn( $s, 'eE', $end );
511511 if( $exponent ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103910Follow-up r103865. Accept lowercase hex and remove empty statement.platonides16:04, 22 November 2011
r103931Follow-up r103915: We need to increment $end before the strcspn....platonides18:10, 22 November 2011

Status & tagging log