regexp.prototype.flags
Advanced tools
Comparing version
@@ -0,1 +1,14 @@ | ||
1.3.0 / 2019-12-14 | ||
================= | ||
* [New] add `auto` entry point | ||
* [Refactor] use `callBind` helper from `es-abstract` | ||
* [Deps] update `define-properties` | ||
* [meta] add `funding` field | ||
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `has`, `tape` | ||
* [Tests] use shared travis-ci configs | ||
* [Tests] use `eclint` instead of `editorconfig-tools` | ||
* [Tests] remove `jscs` | ||
* [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops | ||
* [actions] add automatic rebasing / merge commit blocking | ||
1.2.0 / 2017-10-24 | ||
@@ -2,0 +15,0 @@ ================= |
'use strict'; | ||
var toObject = Object; | ||
var TypeErr = TypeError; | ||
var $Object = Object; | ||
var $TypeError = TypeError; | ||
module.exports = function flags() { | ||
if (this != null && this !== toObject(this)) { | ||
throw new TypeErr('RegExp.prototype.flags getter called on non-object'); | ||
if (this != null && this !== $Object(this)) { | ||
throw new $TypeError('RegExp.prototype.flags getter called on non-object'); | ||
} | ||
@@ -10,0 +10,0 @@ var result = ''; |
'use strict'; | ||
var define = require('define-properties'); | ||
var callBind = require('es-abstract/helpers/callBind'); | ||
@@ -9,3 +10,3 @@ var implementation = require('./implementation'); | ||
var flagsBound = Function.call.bind(implementation); | ||
var flagsBound = callBind(implementation); | ||
@@ -12,0 +13,0 @@ define(flagsBound, { |
{ | ||
"name": "regexp.prototype.flags", | ||
"version": "1.2.0", | ||
"author": "Jordan Harband", | ||
"version": "1.3.0", | ||
"author": "Jordan Harband <ljharb@gmail.com>", | ||
"funding": { | ||
"url": "https://github.com/sponsors/ljharb" | ||
}, | ||
"description": "ES6 spec-compliant RegExp.prototype.flags shim.", | ||
@@ -9,13 +12,10 @@ "license": "MIT", | ||
"scripts": { | ||
"pretest": "npm run --silent lint", | ||
"test": "npm run --silent tests-only", | ||
"posttest": "npm run --silent security", | ||
"pretest": "npm run lint", | ||
"test": "npm run tests-only", | ||
"posttest": "npx aud", | ||
"tests-only": "es-shim-api --bound && node --harmony --es-staging test/index.js", | ||
"coverage": "covert test/*.js", | ||
"coverage-quiet": "covert test/*.js --quiet", | ||
"lint": "npm run --silent jscs && npm run --silent eslint", | ||
"eslint": "eslint test/*.js *.js", | ||
"jscs": "jscs test/*.js *.js", | ||
"eccheck": "editorconfig-tools check *.js **/*.js > /dev/null", | ||
"security": "nsp check" | ||
"lint": "eslint .", | ||
"eccheck": "eclint check *.js **/*.js > /dev/null" | ||
}, | ||
@@ -40,14 +40,13 @@ "repository": { | ||
"dependencies": { | ||
"define-properties": "^1.1.2" | ||
"define-properties": "^1.1.3", | ||
"es-abstract": "^1.17.0-next.1" | ||
}, | ||
"devDependencies": { | ||
"@es-shims/api": "^1.3.0", | ||
"@ljharb/eslint-config": "^12.2.1", | ||
"covert": "^1.1.0", | ||
"editorconfig-tools": "^0.1.1", | ||
"eslint": "^4.9.0", | ||
"has": "^1.0.1", | ||
"jscs": "^3.0.7", | ||
"nsp": "^2.8.1", | ||
"tape": "^4.8.0" | ||
"@es-shims/api": "^2.1.2", | ||
"@ljharb/eslint-config": "^15.0.2", | ||
"covert": "^1.1.1", | ||
"eclint": "^2.8.1", | ||
"eslint": "^6.7.2", | ||
"has": "^1.0.3", | ||
"tape": "^4.11.0" | ||
}, | ||
@@ -54,0 +53,0 @@ "testling": { |
@@ -6,11 +6,11 @@ 'use strict'; | ||
var supportsDescriptors = require('define-properties').supportsDescriptors; | ||
var gOPD = Object.getOwnPropertyDescriptor; | ||
var TypeErr = TypeError; | ||
var $gOPD = Object.getOwnPropertyDescriptor; | ||
var $TypeError = TypeError; | ||
module.exports = function getPolyfill() { | ||
if (!supportsDescriptors) { | ||
throw new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors'); | ||
throw new $TypeError('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors'); | ||
} | ||
if (/a/mig.flags === 'gim') { | ||
var descriptor = gOPD(RegExp.prototype, 'flags'); | ||
if ((/a/mig).flags === 'gim') { | ||
var descriptor = $gOPD(RegExp.prototype, 'flags'); | ||
if (descriptor && typeof descriptor.get === 'function' && typeof (/a/).dotAll === 'boolean') { | ||
@@ -17,0 +17,0 @@ return descriptor.get; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
7
-22.22%15793
-34.8%2
100%212
-34.37%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
Updated