Skip to content

Commit

Permalink
fix ascii filter in builder
Browse files Browse the repository at this point in the history
  • Loading branch information
nightwing committed Jan 7, 2014
1 parent b79cb61 commit 30a4d12
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Makefile.dryice.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,19 @@ function getWriteFilters(options, projectType) {
if (options.compress)
filters.push(copy.filter.uglifyjs);

copy.filter.uglifyjs.options.ascii = true;

// copy.filter.uglifyjs.options.ascii = true; doesn't work with some uglify.js versions
filters.push(function(text) {
var t1 = text.replace(/[\x80-\uffff]/g, function(c) {
c = c.charCodeAt(0).toString(16);
if (c.length == 2)
return "\\x" + c;
if (c.length == 3)
c = "0" + c;
return "\\u" + c;
});
return text;
});

if (options.exportModule && projectType == "main") {
if (options.noconflict)
filters.push(exportAce(options.ns, options.exportModule, options.ns));
Expand Down

0 comments on commit 30a4d12

Please sign in to comment.