Skip to content

Commit 798a7a7

Browse files
committed
Use Uglify's ascii_only to avoid converting UTF-8 escapes.
Thanks @curiousdannii!
1 parent a60fed4 commit 798a7a7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

grunt.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ module.exports = function( grunt ) {
112112
],
113113
tasks: "dev"
114114
},
115-
uglify: {}
115+
uglify: {
116+
codegen: {
117+
ascii_only: true
118+
}
119+
}
116120
});
117121

118122
// Default grunt.

src/core.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,7 @@ jQuery.extend({
605605
},
606606

607607
// Use native String.trim function wherever possible
608-
// Uglify converts escapes to UTF-8; this circumvents (#12690)
609-
trim: core_trim && !core_trim.call( String.fromCharCode( 0xFEFF, 0xA0 ) ) ?
608+
trim: core_trim && !core_trim.call("\xFEFF\xA0") ?
610609
function( text ) {
611610
return text == null ?
612611
"" :

0 commit comments

Comments
 (0)