summaryrefslogtreecommitdiff
path: root/includes/libs/JavaScriptMinifier.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/libs/JavaScriptMinifier.php')
-rw-r--r--includes/libs/JavaScriptMinifier.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/includes/libs/JavaScriptMinifier.php b/includes/libs/JavaScriptMinifier.php
index 2990782c..141a5153 100644
--- a/includes/libs/JavaScriptMinifier.php
+++ b/includes/libs/JavaScriptMinifier.php
@@ -565,6 +565,14 @@ class JavaScriptMinifier {
$out .= ' ';
$lineLength++;
}
+ if (
+ $type === self::TYPE_LITERAL
+ && ( $token === 'true' || $token === 'false' )
+ && ( $state === self::EXPRESSION || $state === self::PROPERTY_EXPRESSION )
+ && $last !== '.'
+ ) {
+ $token = ( $token === 'true' ) ? '!0' : '!1';
+ }
$out .= $token;
$lineLength += $end - $pos; // += strlen( $token )