Make _.uniqueId consistently return a string value.

Former-commit-id: 5a5c626df83b0fc78e9bae37510680383f112c0b
This commit is contained in:
John-David Dalton
2012-11-29 22:17:00 -08:00
parent 529c5b8abf
commit 619ba13265
7 changed files with 165 additions and 134 deletions

View File

@@ -105,7 +105,7 @@
'isDate': [],
'isElement': [],
'isEmpty': ['forOwn', 'isArguments', 'isFunction'],
'isEqual': ['forOwn', 'isFunction'],
'isEqual': ['forIn', 'isFunction'],
'isFinite': [],
'isFunction': [],
'isNaN': ['isNumber'],
@@ -1434,6 +1434,14 @@
' }'
].join('\n'));
// replace `_.uniqueId`
source = replaceFunction(source, 'uniqueId', [
' function uniqueId(prefix) {',
' var id = idCounter++;',
' return prefix ? prefix + id : id;',
' }'
].join('\n'));
// replace `_.without`
source = replaceFunction(source, 'without', [
' function without(array) {',