#5966·UglifyJS

Mangle option debug produces syntax error for private properties

Author: AshleyScirraCreated Jan 6, 2025Updated Jan 6, 2025

Uglify version (uglifyjs -V) 3.19.3

JavaScript input

javascript
class Test {
	#test;
}

The uglifyjs CLI command executed or minify() options used.

uglifyjs input.js --mangle-props debug --beautify --output output.js

JavaScript output or error produced.

javascript
class Test {
    #_$#test$_;
}

The output code is a syntax error because it includes the character # twice: the private property was renamed to #_$#test$_ instead of #_$test$_.