* Returns native `RegExp` flags used by a regex object. * * @private * @param {RegExp} regex Regex to check. * @returns {String} Native flags in use.
(regex)
| 139210 | * @returns {String} Native flags in use. |
| 139211 | */ |
| 139212 | function getNativeFlags(regex) { |
| 139213 | return hasFlagsProp ? regex.flags : |
| 139214 | // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or concatenation |
| 139215 | // with an empty string) allows this to continue working predictably when |
| 139216 | // `XRegExp.proptotype.toString` is overridden |
| 139217 | nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; |
| 139218 | } |
| 139219 | |
| 139220 | /** |
| 139221 | * Determines whether a regex has extended instance data used to track capture names. |