r103931 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103930‎ | r103931 | r103932 >
Date:18:10, 22 November 2011
Author:platonides
Status:ok
Tags:
Comment:
Follow-up r103915: We need to increment $end before the strcspn.
Adjusting the tests, since it is now adding the newline after the number.
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
@@ -114,7 +114,7 @@
115115 $suffix = ',shortVarName=0;';
116116
117117 $input = $prefix . $num . $suffix;
118 - $expected = $prefix . "\n" . $num . $suffix;
 118+ $expected = $prefix . $num . "\n" . $suffix;
119119
120120 $minified = JavaScriptMinifier::minify( $input );
121121
Index: trunk/phase3/includes/libs/JavaScriptMinifier.php
@@ -511,6 +511,7 @@
512512 if ( $exponent > 1 ) {
513513 return self::parseError($s, $end, 'Number with several E' );
514514 }
 515+ $end++;
515516
516517 // + sign is optional; - sign is required.
517518 $end += strspn( $s, '-+', $end );
@@ -518,7 +519,7 @@
519520 if ( !$len ) {
520521 return self::parseError($s, $pos, 'No decimal digits after e, how many zeroes should be added?' );
521522 }
522 - $end += $len + 1;
 523+ $end += $len;
523524 }
524525 } elseif( isset( $opChars[$ch] ) ) {
525526 // Punctuation character. Search for the longest matching operator.

Follow-up revisions

RevisionCommit summaryAuthorDate
r103940Final fixup to r103910 and follow-ups....platonides18:56, 22 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103915Fix r103865 fixmes about case where there a parse error should be raised....platonides16:21, 22 November 2011

Status & tagging log