Same name in other branches
- 5.0.x advagg_js_minify/jspacker.inc \JavaScriptPacker::_encodeSpecialChars()
- 6.0.x advagg_js_minify/jspacker.inc \JavaScriptPacker::_encodeSpecialChars()
- 7.x-2.x advagg_js_compress/jspacker.inc \JavaScriptPacker::_encodeSpecialChars()
- 8.x-2.x advagg_js_minify/jspacker.inc \JavaScriptPacker::_encodeSpecialChars()
- 8.x-3.x advagg_js_minify/jspacker.inc \JavaScriptPacker::_encodeSpecialChars()
- 8.x-4.x advagg_js_minify/jspacker.inc \JavaScriptPacker::_encodeSpecialChars()
Fichier
-
advagg_js_compress/
jspacker.inc, line 155
Classe
Code
private function _encodeSpecialChars($script) {
$parser = new ParseMaster();
// replace: $name -> n, $$name -> na
$parser->add('/((\\x24+)([a-zA-Z$_]+))(\\d*)/', array(
'fn' => '_replace_name',
));
// replace: _name -> _0, double-underscore (__name) is ignored
$regexp = '/\\b_[A-Za-z\\d]\\w*/';
// build the word list
$keywords = $this->_analyze($script, $regexp, '_encodePrivate');
// quick ref
$encoded = $keywords['encoded'];
$parser->add($regexp, array(
'fn' => '_replace_encoded',
'data' => $encoded,
));
return $parser->exec($script);
}