This commit is contained in:
Ashley (Scirra) 2017-03-23 10:15:38 +00:00 committed by GitHub
commit 1a3b5fd719

View File

@ -84,6 +84,7 @@ function mangle_properties(ast, options) {
var regex = options.regex; var regex = options.regex;
var ignore_quoted = options.ignore_quoted; var ignore_quoted = options.ignore_quoted;
var debug = options.debug;
// note debug is either false (disabled), or a string of the debug suffix to use (enabled). // note debug is either false (disabled), or a string of the debug suffix to use (enabled).
// note debug may be enabled as an empty string, which is falsey. Also treat passing 'true' // note debug may be enabled as an empty string, which is falsey. Also treat passing 'true'
@ -185,6 +186,9 @@ function mangle_properties(ast, options) {
if (!should_mangle(name)) { if (!should_mangle(name)) {
return name; return name;
} }
if (debug)
return "_$" + name + "$_";
var mangled = cache.props.get(name); var mangled = cache.props.get(name);
if (!mangled) { if (!mangled) {