Bump to v4.9.0.

This commit is contained in:
John-David Dalton
2016-04-07 21:49:55 -07:00
parent 7c17af79c7
commit 7d39d58e43
53 changed files with 428 additions and 317 deletions

View File

@@ -1,6 +1,3 @@
var isFunction = require('./isFunction'),
toString = require('./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 '';
}
module.exports = toSource;