Page MenuHomePhorge

D25571.1734654417.diff
No OneTemporary

D25571.1734654417.diff

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

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)

Event Timeline