string-trim-forced.js 535 B

123456789101112131415
  1. var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER;
  2. var fails = require('../internals/fails');
  3. var whitespaces = require('../internals/whitespaces');
  4. var non = '\u200B\u0085\u180E';
  5. // check that a method works with the correct list
  6. // of whitespaces and has a correct name
  7. module.exports = function (METHOD_NAME) {
  8. return fails(function () {
  9. return !!whitespaces[METHOD_NAME]()
  10. || non[METHOD_NAME]() !== non
  11. || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
  12. });
  13. };