regexp.prototype.flags
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -8,2 +8,8 @@ # Changelog | ||
## [v1.4.1](https://github.com/es-shims/RegExp.prototype.flags/compare/v1.4.0...v1.4.1) - 2022-01-13 | ||
### Commits | ||
- [Fix] `polyfill`: do not throw in a descriptorless environment [`e2d24e7`](https://github.com/es-shims/RegExp.prototype.flags/commit/e2d24e707a44d958a0b6d3a114effb2f2b475337) | ||
## [v1.4.0](https://github.com/es-shims/RegExp.prototype.flags/compare/v1.3.2...v1.4.0) - 2022-01-13 | ||
@@ -10,0 +16,0 @@ |
{ | ||
"name": "regexp.prototype.flags", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"author": "Jordan Harband <ljharb@gmail.com>", | ||
@@ -5,0 +5,0 @@ "funding": { |
@@ -7,9 +7,5 @@ 'use strict'; | ||
var $gOPD = Object.getOwnPropertyDescriptor; | ||
var $TypeError = TypeError; | ||
module.exports = function getPolyfill() { | ||
if (!supportsDescriptors) { | ||
throw new $TypeError('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors'); | ||
} | ||
if ((/a/mig).flags === 'gim') { | ||
if (supportsDescriptors && (/a/mig).flags === 'gim') { | ||
var descriptor = $gOPD(RegExp.prototype, 'flags'); | ||
@@ -16,0 +12,0 @@ if (descriptor && typeof descriptor.get === 'function' && typeof (/a/).dotAll === 'boolean') { |
34139
225