debian-mirror-gitlab/core-js/internals/correct-is-regexp-logic.js
2019-09-25 13:30:05 +05:30

15 lines
356 B
JavaScript

var wellKnownSymbol = require('../internals/well-known-symbol');
var MATCH = wellKnownSymbol('match');
module.exports = function (METHOD_NAME) {
var regexp = /./;
try {
'/./'[METHOD_NAME](regexp);
} catch (e) {
try {
regexp[MATCH] = false;
return '/./'[METHOD_NAME](regexp);
} catch (f) { /* empty */ }
} return false;
};