Cleanup whitespace characters in strings and fix a whitespace bug in Closure Compiler.

Former-commit-id: d1ab43648f3084b7bcfbd471728b71cea48aa9be
This commit is contained in:
John-David Dalton
2013-04-27 02:24:25 -07:00
parent 183b2548cf
commit e5d34890a9
8 changed files with 17 additions and 10 deletions

View File

@@ -28,7 +28,14 @@
source = source.replace(/^\/\**[\s\S]+?\*\/\n/, '');
// correct overly aggressive Closure Compiler advanced optimization
source = source.replace(/(document[^&]+&&)\s*(?:\w+|!\d)/, '$1!({toString:0}+"")');
source = source
.replace(/(document[^&]+&&)\s*(?:\w+|!\d)/, '$1!({toString:0}+"")')
.replace(/"\t"/g, '"\\t"')
.replace(/"[^"]*?\\u180e[^"]*?"/g,
'" \\t\\x0B\\f\\xa0\\ufeff' +
'\\n\\r\\u2028\\u2029' +
'\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000"'
);
// flip `typeof` expressions to help optimize Safari and
// correct the AMD module definition for AMD build optimizers