You are here

constant JavaScriptPacker::JSFUNCTION_decodeBody in Advanced CSS/JS Aggregation 7

Same name and namespace in other branches
  1. 8.4 advagg_js_minify/jspacker.inc \JavaScriptPacker::JSFUNCTION_decodeBody
  2. 8.2 advagg_js_minify/jspacker.inc \JavaScriptPacker::JSFUNCTION_decodeBody
  3. 8.3 advagg_js_minify/jspacker.inc \JavaScriptPacker::JSFUNCTION_decodeBody
  4. 6 advagg_js_compress/jspacker.inc \JavaScriptPacker::JSFUNCTION_decodeBody
  5. 7.2 advagg_js_compress/jspacker.inc \JavaScriptPacker::JSFUNCTION_decodeBody

File

advagg_js_compress/jspacker.inc, line 496

Class

JavaScriptPacker

Code

const JSFUNCTION_decodeBody = '    if (!\'\'.replace(/^/, String)) {
        // decode all the values we need
        while ($count--) {
            $decode[$encode($count)] = $keywords[$count] || $encode($count);
        }
        // global replacement function
        $keywords = [function ($encoded) {return $decode[$encoded]}];
        // generic match
        $encode = function () {return \'\\\\w+\'};
        // reset the loop counter -  we are now doing a global replace
        $count = 1;
    }
';