X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=node_modules%2Fgrunt-uncss%2Fnode_modules%2Flodash%2F_toSource.js;fp=node_modules%2Fgrunt-uncss%2Fnode_modules%2Flodash%2F_toSource.js;h=a020b386ca3137fea6823ce29e5c360bff78e799;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/node_modules/grunt-uncss/node_modules/lodash/_toSource.js b/node_modules/grunt-uncss/node_modules/lodash/_toSource.js new file mode 100644 index 000000000..a020b386c --- /dev/null +++ b/node_modules/grunt-uncss/node_modules/lodash/_toSource.js @@ -0,0 +1,26 @@ +/** Used for built-in method references. */ +var funcProto = Function.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @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 ''; +} + +module.exports = toSource;