_fails-is-regexp.js 251 B

12345678910111213
  1. var MATCH = require('./_wks')('match');
  2. module.exports = function (KEY) {
  3. var re = /./;
  4. try {
  5. '/./'[KEY](re);
  6. } catch (e) {
  7. try {
  8. re[MATCH] = false;
  9. return !'/./'[KEY](re);
  10. } catch (f) { /* empty */ }
  11. } return true;
  12. };