Skip to content

Commit 221b347

Browse files
committed
Update vendor/underscore to v1.4.3 and update the Underscore build compatibility.
Former-commit-id: ebcaad4a92848bef3bbf65bb8eb3a0c1553e005c
1 parent af9bf3e commit 221b347

File tree

4 files changed

+19
-24
lines changed

4 files changed

+19
-24
lines changed

build.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@
841841
// clip snippet after the JSDoc comment block
842842
match = match.replace(/^\s*(?:\/\/.*|\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)\n/, '');
843843
source = source.replace(match, function() {
844-
return funcValue;
844+
return funcValue.trimRight() + '\n';
845845
});
846846
}
847847
return source;
@@ -1313,13 +1313,6 @@
13131313
' }'
13141314
].join('\n'));
13151315

1316-
// replace `_.isFinite`
1317-
source = replaceFunction(source, 'isFinite', [
1318-
' function isFinite(value) {',
1319-
' return nativeIsFinite(value) && toString.call(value) == numberClass;',
1320-
' }'
1321-
].join('\n'));
1322-
13231316
// replace `_.omit`
13241317
source = replaceFunction(source, 'omit', [
13251318
' function omit(object) {',
@@ -1412,6 +1405,11 @@
14121405
' result = [],',
14131406
' seen = result;',
14141407
'',
1408+
" if (typeof isSorted == 'function') {",
1409+
' thisArg = callback;',
1410+
' callback = isSorted;',
1411+
' isSorted = false;',
1412+
' }',
14151413
' if (callback) {',
14161414
' seen = [];',
14171415
' callback = createCallback(callback, thisArg);',
@@ -1437,7 +1435,7 @@
14371435
// replace `_.uniqueId`
14381436
source = replaceFunction(source, 'uniqueId', [
14391437
' function uniqueId(prefix) {',
1440-
' var id = idCounter++;',
1438+
" var id = ++idCounter + '';",
14411439
' return prefix ? prefix + id : id;',
14421440
' }'
14431441
].join('\n'));

test/test-build.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,6 @@
679679

680680
object = { 'length': 0, 'splice': Array.prototype.splice };
681681
equal(lodash.isEmpty(object), false, '_.isEmpty should return `false` for jQuery/MooTools DOM query collections: ' + basename);
682-
equal(lodash.isFinite('2'), false, '_.isFinite should return `false` for numeric string values: ' + basename);
683682

684683
object = { 'a': 1, 'b': 2, 'c': 3 };
685684
equal(lodash.isEqual(object, { 'a': 1, 'b': 0, 'c': 3 }), false, '_.isEqual: ' + basename);
@@ -697,10 +696,7 @@
697696

698697
equal(lodash.some([false, true, false]), true, '_.some: ' + basename);
699698
equal(lodash.template('${a}', object), '${a}', '_.template should ignore ES6 delimiters: ' + basename);
700-
701-
actual = [lodash.uniqueId(3), lodash.uniqueId(2), lodash.uniqueId(1)];
702-
equal(actual.join(','), '3,3,3', '_.uniqueId should not coerce the prefix argument to a string: ' + basename);
703-
equal(typeof lodash.uniqueId(), 'number', '_.uniqueId should return a number value when not passing a prefix argument: ' + basename);
699+
equal(lodash.uniqueId(0), '1', '_.uniqueId should ignore a prefix of `0`: ' + basename);
704700

705701
var wrapped = lodash(1);
706702
equal(wrapped.clone() instanceof lodash, false, '_(...) wrapped values are not chainable by default: ' + basename);

0 commit comments

Comments
 (0)