_fails-is-regexp.js 251 B

123456789101112
  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. };