Optimize inlining the iteratorTemplate for builds.

Former-commit-id: 8b7ac4622e51dbe5c0364f3c6781aa474dcfa96e
This commit is contained in:
John-David Dalton
2012-06-30 03:06:21 -04:00
parent 3717d30188
commit 6af4652161
3 changed files with 97 additions and 49 deletions

View File

@@ -253,13 +253,13 @@
var snippets = source.match(
RegExp([
// match the `iteratorTemplate`
'var iteratorTemplate\\b[\\s\\S]+?\\);\\n',
'( +)var iteratorTemplate\\b[\\s\\S]+?\\n\\1}',
// match methods created by `createIterator` calls
'createIterator\\((?:{|[a-zA-Z]+)[\\s\\S]+?\\);\\n',
// match variables storing `createIterator` options
'( +)var [a-zA-Z]+IteratorOptions\\b[\\s\\S]+?\\n\\1}',
'( +)var [a-zA-Z]+IteratorOptions\\b[\\s\\S]+?\\n\\2}',
// match the the `createIterator` function
'( +)function createIterator\\b[\\s\\S]+?\\n\\2}'
'( +)function createIterator\\b[\\s\\S]+?\\n\\3}'
].join('|'), 'g')
);