set-function-length
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -8,2 +8,11 @@ # Changelog | ||
## [v1.1.0](https://github.com/ljharb/set-function-length/compare/v1.0.1...v1.1.0) - 2023-10-13 | ||
### Commits | ||
- [New] add `env` entry point [`475c87a`](https://github.com/ljharb/set-function-length/commit/475c87aa2f59b700aaed589d980624ec596acdcb) | ||
- [Tests] add coverage with `nyc` [`14f0bf8`](https://github.com/ljharb/set-function-length/commit/14f0bf8c145ae60bf14a026420a06bb7be132c36) | ||
- [eslint] fix linting failure [`fb516f9`](https://github.com/ljharb/set-function-length/commit/fb516f93c664057138c53559ef63c8622a093335) | ||
- [Deps] update `define-data-property` [`d727e7c`](https://github.com/ljharb/set-function-length/commit/d727e7c6c9a40d7bf26797694e500ea68741feea) | ||
## [v1.0.1](https://github.com/ljharb/set-function-length/compare/v1.0.0...v1.0.1) - 2023-10-12 | ||
@@ -10,0 +19,0 @@ |
@@ -7,8 +7,14 @@ 'use strict'; | ||
var functionsHaveWritableLengths = gOPD && gOPD(function () {}, 'length').writable; | ||
var boundFnsHaveConfigurableLengths = gOPD && gOPD(function () {}.bind(), 'length').configurable; | ||
var boundFnsHaveWritableLengths = gOPD && gOPD(function () {}.bind(), 'length').writable; | ||
module.exports = { | ||
__proto__: null, | ||
boundFnsHaveConfigurableLengths: boundFnsHaveConfigurableLengths, | ||
functionsHaveConfigurableLengths: functionsHaveConfigurableLengths | ||
boundFnsHaveWritableLengths: boundFnsHaveWritableLengths, | ||
functionsHaveConfigurableLengths: functionsHaveConfigurableLengths, | ||
functionsHaveWritableLengths: functionsHaveWritableLengths | ||
}; |
@@ -22,2 +22,3 @@ 'use strict'; | ||
var functionLengthIsConfigurable = true; | ||
var functionLengthIsWritable = true; | ||
if ('length' in fn && gOPD) { | ||
@@ -28,5 +29,8 @@ var desc = gOPD(fn, 'length'); | ||
} | ||
if (desc && !desc.writable) { | ||
functionLengthIsWritable = false; | ||
} | ||
} | ||
if (functionLengthIsConfigurable || !loose) { | ||
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { | ||
if (hasDescriptors) { | ||
@@ -33,0 +37,0 @@ define(fn, 'length', length, true, true); |
{ | ||
"name": "set-function-length", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Set a function's length property", | ||
@@ -8,2 +8,3 @@ "main": "index.js", | ||
".": "./index.js", | ||
"./env": "./env.js", | ||
"./package.json": "./package.json" | ||
@@ -21,3 +22,3 @@ }, | ||
"pretest": "npm run lint", | ||
"tests-only": "tape 'test/**/*.js'", | ||
"tests-only": "nyc tape 'test/**/*.js'", | ||
"test": "npm run tests-only", | ||
@@ -50,2 +51,3 @@ "posttest": "aud --production", | ||
"auto-changelog": "^2.4.0", | ||
"define-data-property": "^1.1.1", | ||
"es-value-fixtures": "^1.4.2", | ||
@@ -57,2 +59,3 @@ "eslint": "=8.8.0", | ||
"npmignore": "^0.3.0", | ||
"nyc": "^10.3.2", | ||
"object-inspect": "^1.12.3", | ||
@@ -63,3 +66,2 @@ "safe-publish-latest": "^2.0.0", | ||
"dependencies": { | ||
"define-data-property": "^1.1.0", | ||
"get-intrinsic": "^1.2.1", | ||
@@ -66,0 +68,0 @@ "gopd": "^1.0.1", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10338
3
9
48
14
- Removeddefine-data-property@^1.1.0
- Removeddefine-data-property@1.1.4(transitive)