mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
Remove sorting from _.functions.
This commit is contained in:
@@ -5280,7 +5280,7 @@
|
|||||||
function bindAll(object) {
|
function bindAll(object) {
|
||||||
return baseBindAll(object, arguments.length > 1
|
return baseBindAll(object, arguments.length > 1
|
||||||
? baseFlatten(arguments, false, false, 1)
|
? baseFlatten(arguments, false, false, 1)
|
||||||
: baseFunctions(object, keysIn));
|
: functions(object));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -6337,8 +6337,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a sorted array of function property names from all enumerable
|
* Creates an array of function property names from all enumerable properties,
|
||||||
* properties, own and inherited, of `object`.
|
* own and inherited, of `object`.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
@@ -6352,7 +6352,7 @@
|
|||||||
* // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...]
|
* // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...]
|
||||||
*/
|
*/
|
||||||
function functions(object) {
|
function functions(object) {
|
||||||
return baseFunctions(object, keysIn).sort();
|
return baseFunctions(object, keysIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3959,7 +3959,7 @@
|
|||||||
(function() {
|
(function() {
|
||||||
test('should return the function names of an object', 1, function() {
|
test('should return the function names of an object', 1, function() {
|
||||||
var object = { 'a': 'a', 'b': _.identity, 'c': /x/, 'd': _.each };
|
var object = { 'a': 'a', 'b': _.identity, 'c': /x/, 'd': _.each };
|
||||||
deepEqual(_.functions(object), ['b', 'd']);
|
deepEqual(_.functions(object).sort(), ['b', 'd']);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should include inherited functions', 1, function() {
|
test('should include inherited functions', 1, function() {
|
||||||
@@ -3968,7 +3968,7 @@
|
|||||||
this.b = 'b'
|
this.b = 'b'
|
||||||
}
|
}
|
||||||
Foo.prototype.c = _.noop;
|
Foo.prototype.c = _.noop;
|
||||||
deepEqual(_.functions(new Foo), ['a', 'c']);
|
deepEqual(_.functions(new Foo).sort(), ['a', 'c']);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should be aliased', 1, function() {
|
test('should be aliased', 1, function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user