_isMasked.js 564 B

123456789101112131415161718192021
  1. var coreJsData = require('./_coreJsData');
  2. /** Used to detect methods masquerading as native. */
  3. var maskSrcKey = (function() {
  4. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  5. return uid ? ('Symbol(src)_1.' + uid) : '';
  6. }());
  7. /**
  8. * Checks if `func` has its source masked.
  9. *
  10. * @private
  11. * @param {Function} func The function to check.
  12. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  13. */
  14. function isMasked(func) {
  15. return !!maskSrcKey && (maskSrcKey in func);
  16. }
  17. module.exports = isMasked;