Bump to v4.9.0.

This commit is contained in:
John-David Dalton
2016-04-07 21:38:09 -07:00
parent e8cff1ef54
commit b7e3b3febd
49 changed files with 141 additions and 82 deletions

View File

@@ -1,6 +1,3 @@
import isFunction from './isFunction';
import toString from './toString';
/** Used to resolve the decompiled source of functions. */
var funcToString = Function.prototype.toString;
@@ -12,12 +9,15 @@ var funcToString = Function.prototype.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 '';
}
export default toSource;