string-trim-forced.js 549 B

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