From c1011ca87520bf6f3638a3025c86460cbdff85a5 Mon Sep 17 00:00:00 2001 From: nightwing Date: Wed, 26 Feb 2014 17:29:32 +0400 Subject: [PATCH] fix worker build --- Makefile.dryice.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile.dryice.js b/Makefile.dryice.js index add81489..f8e1383c 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -304,7 +304,7 @@ function getWriteFilters(options, projectType, main) { // copy.filter.uglifyjs.options.ascii_only = true; doesn't work with some uglify.js versions filters.push(function(text) { - var text = text.replace(/[\x00-\x09\x0b\x0c\x0e\x19\x80-\uffff]/g, function(c) { + var text = text.replace(/[\x00-\x08\x0b\x0c\x0e\x19\x80-\uffff]/g, function(c) { c = c.charCodeAt(0).toString(16); if (c.length == 1) return "\\x0" + c; @@ -587,14 +587,15 @@ CommonJsProject.prototype.getCurrentModules = function() { } var depMap = {}, modules = this.currentModules; return Object.keys(this.currentModules).map(function(moduleName) { - module = modules[moduleName] + module = modules[moduleName]; module.id = moduleName; + module.isSpecial = !/define\(\'[^']*',/.test(module.source); return module; }).sort(function(a, b) { - if (isDep(a.id, b.id)) - return -1; - if (isDep(b.id, a.id)) - return 1; + if (a.isSpecial) return -1; + if (b.isSpecial) return 1; + if (isDep(a.id, b.id)) return -1; + if (isDep(b.id, a.id)) return 1; return Object.keys(a.deps).length - Object.keys(b.deps).length || a.id.localeCompare(b.id) }); };