r73197 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73196‎ | r73197 | r73198 >
Date:08:04, 17 September 2010
Author:tstarling
Status:ok (Comments)
Tags:
Comment:
Fix for r73196: don't use $this->a as a temporary variable, as promised in the commit message. I reverted it for testing and forgot to save after I reverted back.
Modified paths:
  • /trunk/phase3/includes/libs/JSMin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/libs/JSMin.php
@@ -109,18 +109,18 @@
110110 $runLength = strcspn( $this->input, $interestingChars, $this->inputIndex );
111111 $this->output .= substr( $this->input, $this->inputIndex, $runLength );
112112 $this->inputIndex += $runLength;
113 - $this->a = $this->get();
 113+ $c = $this->get();
114114
115 - if ( $this->a === $this->b ) {
 115+ if ( $c === $this->b ) {
116116 break;
117117 }
118118
119 - if ( $this->a === "\n" || $this->a === null ) {
 119+ if ( $c === "\n" || $c === null ) {
120120 throw new JSMinException( 'Unterminated string literal.' );
121121 }
122122
123 - if ( $this->a === '\\' ) {
124 - $this->output .= $this->a . $this->get();
 123+ if ( $c === '\\' ) {
 124+ $this->output .= $c . $this->get();
125125 }
126126 }
127127 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r73196In JSMin:...tstarling07:59, 17 September 2010

Comments

#Comment by Trevor Parscal (WMF) (talk | contribs)   21:34, 20 September 2010

Are you going to pass your changes upstream? The code came from http://github.com/rgrove/jsmin-php/

Status & tagging log