You are here

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

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

File

advagg_js_minify/jspacker.inc, line 512

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;
    }
';