r82350 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82349‎ | r82350 | r82351 >
Date:21:49, 17 February 2011
Author:catrope
Status:ok
Tags:
Comment:
1.17wmf1: MFT r81207, r82340, r82344 (JS minfier fixes)
Modified paths:
  • /branches/wmf/1.17wmf1/includes/libs/JavaScriptDistiller.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/includes/libs/JavaScriptDistiller.php
@@ -80,8 +80,8 @@
8181 $parser->add( '/\'([^\'\\\\]*(\\\\.[^\'\\\\]*)*)\'/', '$1' );
8282 $parser->add( '/"([^"\\\\]*(\\\\.[^"\\\\]*)*)"/', '$1' );
8383 // Protect regular expressions
84 - $parser->add( '/[ \\t]+(\\/[^\\/\\r\\n\\*][^\\/\\r\\n]*\\/g?i?)/', '$2' );
85 - $parser->add( '/[^\\w\\$\\/\'"*)\\?:]\\/[^\\/\\r\\n\\*][^\\/\\r\\n]*\\/g?i?/', '$1' );
 84+ $parser->add( '/[ \\t]+((\\/[^\\/\\\\]*(\\\\.[^\\/\\\\]*)*\\/(i|g)*))/', '$1' );
 85+ $parser->add( '/([^\\w\\$\\/\'"*)\\?:](\\/[^\\/\\\\]*(\\\\.[^\\/\\\\]*)*\\/(i|g)*))/', '$1' );
8686 // Remove comments
8787 $parser->add( '/\\/\\*(.|[\\r\\n])*?\\*\\//' );
8888 // Preserve the newline after a C++-style comment -- bug 27046
@@ -162,7 +162,7 @@
163163 foreach ($this->_patterns as $reg) {
164164 $regexp .= '(' . substr($reg[self::EXPRESSION], 1, -1) . ')|';
165165 }
166 - $regexp = substr($regexp, 0, -1) . '/';
 166+ $regexp = substr($regexp, 0, -1) . '/S';
167167 $regexp .= ($this->ignoreCase) ? 'i' : '';
168168
169169 $string = $this->_escape($string, $this->escapeChar);
Property changes on: branches/wmf/1.17wmf1/includes/libs/JavaScriptDistiller.php
___________________________________________________________________
Added: svn:mergeinfo
170170 Merged /branches/new-installer/phase3/includes/libs/JavaScriptDistiller.php:r43664-66004
171171 Merged /branches/wmf-deployment/includes/libs/JavaScriptDistiller.php:r53381,60970
172172 Merged /branches/REL1_15/phase3/includes/libs/JavaScriptDistiller.php:r51646
173173 Merged /branches/wmf/1.16wmf4/includes/libs/JavaScriptDistiller.php:r67177,69199,76243,77266
174174 Merged /branches/sqlite/includes/libs/JavaScriptDistiller.php:r58211-58321
175175 Merged /trunk/phase3/includes/libs/JavaScriptDistiller.php:r81207,82340,82344

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81207ParseMaster is designed to use big regexes, with many starting characters....platonides14:19, 30 January 2011
r82340(bug 27492) Fix regexes for matching JS regexes which could get messed up by ...catrope17:08, 17 February 2011
r82344Revert r82340, caused something linke bug 27481 where spaces were being wrong...catrope19:19, 17 February 2011

Status & tagging log