From be4f81f584219fbab6a8bbf6fa5949724c6bce7c Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 12 Aug 2012 21:41:41 -0700 Subject: [PATCH] Remove more unnecessary brackets from template strings during the build process. Former-commit-id: c8e3dfe7d34f9c61fff75512fb4587a987bdf49f --- build.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/build.js b/build.js index 115d7ca2b..97ba1e11c 100755 --- a/build.js +++ b/build.js @@ -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'+" ); /*--------------------------------------------------------------------------*/