diff options
Diffstat (limited to 'node_modules/core-js/internals/correct-is-regexp-logic.js')
| -rw-r--r-- | node_modules/core-js/internals/correct-is-regexp-logic.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/node_modules/core-js/internals/correct-is-regexp-logic.js b/node_modules/core-js/internals/correct-is-regexp-logic.js new file mode 100644 index 0000000..ff99b57 --- /dev/null +++ b/node_modules/core-js/internals/correct-is-regexp-logic.js @@ -0,0 +1,15 @@ +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var MATCH = wellKnownSymbol('match'); + +module.exports = function (METHOD_NAME) { + var regexp = /./; + try { + '/./'[METHOD_NAME](regexp); + } catch (error1) { + try { + regexp[MATCH] = false; + return '/./'[METHOD_NAME](regexp); + } catch (error2) { /* empty */ } + } return false; +}; |
