Use _.include instead of _.includes in perf.js for Underscore compat.

This commit is contained in:
John-David Dalton
2014-11-30 19:42:23 -08:00
parent 76021fb582
commit 66e7b28195

View File

@@ -1044,33 +1044,33 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
suites.push( suites.push(
Benchmark.Suite('`_.includes` iterating an array') Benchmark.Suite('`_.include` iterating an array')
.add(buildName, '\ .add(buildName, '\
lodash.includes(numbers, limit - 1)' lodash.include(numbers, limit - 1)'
) )
.add(otherName, '\ .add(otherName, '\
_.includes(numbers, limit - 1)' _.include(numbers, limit - 1)'
) )
); );
suites.push( suites.push(
Benchmark.Suite('`_.includes` iterating an object') Benchmark.Suite('`_.include` iterating an object')
.add(buildName, '\ .add(buildName, '\
lodash.includes(object, limit - 1)' lodash.include(object, limit - 1)'
) )
.add(otherName, '\ .add(otherName, '\
_.includes(object, limit - 1)' _.include(object, limit - 1)'
) )
); );
if (lodash.includes('ab', 'ab') && _.includes('ab', 'ab')) { if (lodash.include('ab', 'ab') && _.include('ab', 'ab')) {
suites.push( suites.push(
Benchmark.Suite('`_.includes` iterating a string') Benchmark.Suite('`_.include` iterating a string')
.add(buildName, '\ .add(buildName, '\
lodash.includes(strNumbers, "," + (limit - 1))' lodash.include(strNumbers, "," + (limit - 1))'
) )
.add(otherName, '\ .add(otherName, '\
_.includes(strNumbers, "," + (limit - 1))' _.include(strNumbers, "," + (limit - 1))'
) )
); );
} }