allow ascii_only flag on compression
This commit is contained in:
parent
ba939ccd6c
commit
07081ff18c
|
|
@ -225,6 +225,9 @@ if (ARGS.keep_fnames) {
|
|||
if (BEAUTIFY)
|
||||
UglifyJS.merge(OUTPUT_OPTIONS, BEAUTIFY);
|
||||
|
||||
if (COMPRESS)
|
||||
OUTPUT_OPTIONS.ascii_only = !!COMPRESS.ascii_only
|
||||
|
||||
if (ARGS.comments != null) {
|
||||
if (/^\/.*\/[a-zA-Z]*$/.test(ARGS.comments)) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ function Compressor(options, false_by_default) {
|
|||
screw_ie8 : false,
|
||||
drop_console : false,
|
||||
angular : false,
|
||||
ascii_only : false,
|
||||
|
||||
warnings : true,
|
||||
global_defs : {}
|
||||
|
|
|
|||
19
test/compress/ascii_only.js
Normal file
19
test/compress/ascii_only.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
prevents_unicode_escape_sequences_from_being_converted: {
|
||||
options = {ascii_only: true};
|
||||
input: {
|
||||
var a = "\u2000";
|
||||
}
|
||||
expect: {
|
||||
var a = "\u2000";
|
||||
}
|
||||
}
|
||||
|
||||
converts_unicode_characters_to_escape_sequences: {
|
||||
options = {ascii_only: true};
|
||||
input: {
|
||||
var a = " ";
|
||||
}
|
||||
expect: {
|
||||
var a = "\u2000";
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user