Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2682341
D25571.1734654417.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
D25571.1734654417.diff
View Options
diff --git a/externals/JsShrink/jsShrink.php b/externals/JsShrink/jsShrink.php
--- a/externals/JsShrink/jsShrink.php
+++ b/externals/JsShrink/jsShrink.php
@@ -11,7 +11,8 @@
function jsShrink($input) {
return preg_replace_callback('(
(?:
- (^|[-+\([{}=,:;!%^&*|?~]|/(?![/*])|return|throw) # context before regexp
+ (`(?:\\\\.|[^`\\\\])*`) # template literal
+ |(^|[-+\([{}=,:;!%^&*|?~]|/(?![/*])|return|throw) # context before regexp
(?:\s|//[^\n]*+\n|/\*(?:[^*]|\*(?!/))*+\*/)* # optional space
(/(?![/*])(?:
\\\\[^\n]
@@ -31,9 +32,11 @@
function jsShrinkCallback($match) {
static $last = '';
- $match += array_fill(1, 5, null); // avoid E_NOTICE
- list(, $context, $regexp, $result, $word, $operator) = $match;
- if ($word != '') {
+ $match += array_fill(1, 7, null); // avoid E_NOTICE
+ list(, $template, $context, $regexp, $result, $word, $operator) = $match;
+ if ($template) {
+ $result = $template;
+ } elseif ($word != '') {
$result = ($last == 'word' ? "\n" : ($last == 'return' ? " " : "")) . $result;
$last = ($word == 'return' || $word == 'throw' || $word == 'break' || $word == 'async' ? 'return' : 'word');
} elseif ($operator) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 00:26 (20 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1016277
Default Alt Text
D25571.1734654417.diff (1 KB)
Attached To
Mode
D25571: T15774: Celerity: javascript minification issue with template literals (backticked strings)
Attached
Detach File
Event Timeline
Log In to Comment