r81246 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81245‎ | r81246 | r81247 >
Date:12:48, 31 January 2011
Author:catrope
Status:ok
Tags:
Comment:
(bug 27046) Do not strip newlines following C++-style // comments. Prior to this commit, such newlines were always stripped, causing invalid JS output in certain cases. They are now always preserved, even if they would normally qualifiy for vertical whitespace stripping/collapsing when wgResourceLoaderMinifyJSVerticalSpace is enabled.
Modified paths:
  • /trunk/phase3/includes/libs/JavaScriptDistiller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/libs/JavaScriptDistiller.php
@@ -84,7 +84,8 @@
8585 $parser->add( '/[^\\w\\$\\/\'"*)\\?:]\\/[^\\/\\r\\n\\*][^\\/\\r\\n]*\\/g?i?/', '$1' );
8686 // Remove comments
8787 $parser->add( '/\\/\\*(.|[\\r\\n])*?\\*\\//' );
88 - $parser->add( '/\\/\\/[^\\r\\n]*[\\r\\n]/' );
 88+ // Preserve the newline after a C++-style comment -- bug 27046
 89+ $parser->add( '/\\/\\/[^\\r\\n]*([\\r\\n])/', '$2' );
8990 return $parser;
9091 }
9192 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r814111.17: MFT r81186, r81187, r81197, r81209, r81210, r81211, r81215, r81238, r81...catrope20:23, 2 February 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81212Workaround for bug 27046: add semicolon where implied statement terminator wa...brion20:23, 30 January 2011

Status & tagging log