mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Bump to v4.9.0.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
define(['./isFunction', './toString'], function(isFunction, toString) {
|
||||
define([], function() {
|
||||
|
||||
/** Used to resolve the decompiled source of functions. */
|
||||
var funcToString = Function.prototype.toString;
|
||||
@@ -11,12 +11,15 @@ define(['./isFunction', './toString'], function(isFunction, toString) {
|
||||
* @returns {string} Returns the source code.
|
||||
*/
|
||||
function toSource(func) {
|
||||
if (isFunction(func)) {
|
||||
if (func != null) {
|
||||
try {
|
||||
return funcToString.call(func);
|
||||
} catch (e) {}
|
||||
try {
|
||||
return (func + '');
|
||||
} catch (e) {}
|
||||
}
|
||||
return toString(func);
|
||||
return '';
|
||||
}
|
||||
|
||||
return toSource;
|
||||
|
||||
Reference in New Issue
Block a user