Remove more unnecessary brackets from template strings during the build process.

Former-commit-id: c8e3dfe7d34f9c61fff75512fb4587a987bdf49f
This commit is contained in:
John-David Dalton
2012-08-12 21:41:41 -07:00
parent 361c91e610
commit be4f81f584

View File

@@ -819,14 +819,13 @@
/*--------------------------------------------------------------------------*/
// simplify template snippets
// simplify template snippets by removing unnecessary brackets
source = source.replace(
RegExp(
"'else if \\(thisArg\\) \\{\\\\n' \\+\\s*" +
"' callback = iteratorBind\\(callback, thisArg\\)\\\\n' \\+\\s*" +
"'}'"
, 'g'),
"'else if (thisArg) callback = iteratorBind(callback, thisArg)'"
RegExp("{(\\\\n' *\\+\\s*.*?\\+\\n\\s*')}(?:\\\\n)?' *([,\\n])", 'g'), "$1'$2"
);
source = source.replace(
RegExp("{(\\\\n' *\\+\\s*.*?\\+\\n\\s*')}(?:\\\\n)?' *\\+", 'g'), "$1;\\n'+"
);
/*--------------------------------------------------------------------------*/