Files
lodash/_toSource.js
John-David Dalton b7e3b3febd Bump to v4.9.0.
2016-04-08 01:32:35 -07:00

24 lines
482 B
JavaScript

/** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString;
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to process.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
export default toSource;