You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
287 B

4 years ago
  1. 'use strict';
  2. var getInferredName;
  3. try {
  4. // eslint-disable-next-line no-new-func
  5. getInferredName = Function('s', 'return { [s]() {} }[s].name;');
  6. } catch (e) {}
  7. var inferred = function () {};
  8. module.exports = getInferredName && inferred.name === 'inferred' ? getInferredName : null;