Ensure _.toArray returns a dence array.

Former-commit-id: 534091d4d200208b8aa831d86801d5e9d73410fe
This commit is contained in:
John-David Dalton
2012-11-30 22:51:15 -08:00
parent 6b35c097d6
commit 3e11d58d73
3 changed files with 76 additions and 41 deletions

View File

@@ -1213,7 +1213,7 @@
source = replaceFunction(source, 'clone', [
' function clone(value) {',
' return value && objectTypes[typeof value]',
' ? (isArray(value) ? slice.call(value) : assign({}, value))',
' ? (isArray(value) ? slice(value) : assign({}, value))',
' : value',
' }'
].join('\n'));
@@ -1713,7 +1713,7 @@
// remove `noCharByIndex` from `_.toArray`
source = source.replace(matchFunction(source, 'toArray'), function(match) {
return match.replace(/(?:\s*\/\/.*)*\n( *)if *\(noCharByIndex[\s\S]+?\n\1}/, '');
return match.replace(/noCharByIndex[^:]+:/, '');
});
// replace `createFunction` with `Function` in `_.template`