Simplify regexps in build.js.

Former-commit-id: 7640f90b6aeca0438579c15c9eef270904c2c523
This commit is contained in:
John-David Dalton
2012-05-31 22:54:37 -06:00
parent f6e2ae41d6
commit 5d2928d2b3

View File

@@ -251,9 +251,9 @@
// match a function declaration // match a function declaration
'( +)function ' + funcName + '\\b[\\s\\S]+?\\n\\1}|' + '( +)function ' + funcName + '\\b[\\s\\S]+?\\n\\1}|' +
// match a variable declaration with `createIterator` // match a variable declaration with `createIterator`
' +var ' + funcName + ' *= *(?:[a-zA-Z]+ *\\|\\| *)?createIterator\\((?:{|[a-zA-Z])[\\s\\S]+?\\);|' + ' +var ' + funcName + ' *=.*createIterator\\((?:{|[a-zA-Z])[\\s\\S]+?\\);|' +
// match a variable declaration with function expression // match a variable declaration with function expression
'( +)var ' + funcName + ' *= *(?:[a-zA-Z]+ *\\|\\| *)?function[\\s\\S]+?\\n\\2};' + '( +)var ' + funcName + ' *=.*function[\\s\\S]+?\\n\\2};' +
// end non-capturing group // end non-capturing group
')\\n' ')\\n'
)); ));
@@ -484,7 +484,7 @@
} }
// remove pseudo private properties // remove pseudo private properties
source = source.replace(/(?:\s*\/\/.*)*\s*lodash\._[^=]+=.+\n/g, '\n'); source = source.replace(/(?:(?:\s*\/\/.*)*\s*lodash\._[^=]+=.+\n)+/g, '\n');
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/