From 30a4d12eb7c0ed43134fc8c4356e226ca832601a Mon Sep 17 00:00:00 2001 From: nightwing Date: Tue, 7 Jan 2014 22:39:07 +0400 Subject: [PATCH] fix ascii filter in builder --- Makefile.dryice.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile.dryice.js b/Makefile.dryice.js index 48e90961..549f3665 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -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));