Socket
Socket
Sign inDemoInstall

function.prototype.name

Package Overview
Dependencies
64
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.2 to 1.1.3

.editorconfig

11

CHANGELOG.md

@@ -0,1 +1,12 @@

1.1.3 / 2020-11-27
=================
* [Deps] update `es-abstract`, `functions-have-names`; use `call-bind` where applicable
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `make-arrow-function`, `make-generator-function`; add `aud`, `make-async-function`
* [actions] add "Allow Edits" workflow
* [actions] switch Automatic Rebase workflow to `pull_request_target` event
* [Tests] migrate tests to Github Actions
* [Tests] run `nyc` on all tests
* [Tests] add `implementation` test; run `es-shim-api` in postlint; use `tape` runner
* [Tests] only audit prod deps
1.1.2 / 2019-12-14

@@ -2,0 +13,0 @@ =================

4

implementation.js
'use strict';
var IsCallable = require('es-abstract/2019/IsCallable');
var IsCallable = require('es-abstract/2020/IsCallable');
var functionsHaveNames = require('functions-have-names')();
var callBound = require('es-abstract/helpers/callBound');
var callBound = require('call-bind/callBound');
var $functionToString = callBound('Function.prototype.toString');

@@ -7,0 +7,0 @@ var $stringMatch = callBound('String.prototype.match');

'use strict';
var define = require('define-properties');
var callBind = require('es-abstract/helpers/callBind');
var callBind = require('call-bind');

@@ -6,0 +6,0 @@ var implementation = require('./implementation');

{
"name": "function.prototype.name",
"version": "1.1.2",
"version": "1.1.3",
"author": "Jordan Harband <ljharb@gmail.com>",

@@ -15,6 +15,7 @@ "funding": {

"test": "npm run --silent tests-only",
"posttest": "npx aud",
"tests-only": "es-shim-api --bound && node test && node test/shimmed && node test/uglified",
"coverage": "covert test",
"posttest": "aud --production",
"tests-only": "nyc tape 'test/**/*.js'",
"prelint": "npm run eccheck",
"lint": "eslint .",
"postlint": "es-shim-api --bound",
"eccheck": "eclint check '*.js' '**/*.js'"

@@ -37,16 +38,21 @@ },

"dependencies": {
"call-bind": "^1.0.0",
"define-properties": "^1.1.3",
"es-abstract": "^1.17.0-next.1",
"functions-have-names": "^1.2.0"
"es-abstract": "^1.18.0-next.1",
"functions-have-names": "^1.2.1"
},
"devDependencies": {
"@es-shims/api": "^2.1.2",
"@ljharb/eslint-config": "^15.0.2",
"covert": "^1.1.1",
"@ljharb/eslint-config": "^17.3.0",
"aud": "^1.1.3",
"eclint": "^2.8.1",
"eslint": "^6.7.2",
"make-arrow-function": "^1.1.0",
"make-generator-function": "^1.1.0",
"eslint": "^7.14.0",
"for-each": "^0.3.3",
"has-strict-mode": "^1.0.0",
"make-arrow-function": "^1.2.0",
"make-async-function": "^1.0.0",
"make-generator-function": "^2.0.0",
"nyc": "^10.3.2",
"safe-publish-latest": "^1.1.4",
"tape": "^4.11.0",
"tape": "^5.0.1",
"uglify-register": "^1.0.1"

@@ -53,0 +59,0 @@ },

'use strict';
var functionsHaveNames = require('functions-have-names')();
var arrowFn = require('make-arrow-function')();
var genFn = require('make-generator-function');
var arrows = require('make-arrow-function').list();
var generators = require('make-generator-function')();
var asyncs = require('make-async-function').list();
var forEach = require('for-each');

@@ -25,28 +27,26 @@ var foo = Object(function foo() {});

t.test('arrow functions', { skip: !arrowFn }, function (st) {
if (functionsHaveNames) {
st.equal(getName(arrowFn), arrowFn.name, 'arrow function name matches');
}
st.equal(getName(arrowFn), '', 'arrow function has correct name');
t.test('arrow functions', { skip: arrows.length === 0 }, function (st) {
st.equal(true, functionsHaveNames, 'functions have names in any env with arrow functions');
forEach(arrows, function (arrowFn) {
st.equal(getName(arrowFn), arrowFn.name, 'arrow function name matches for ' + arrowFn);
});
st.end();
});
t.test('generators', { skip: !genFn }, function (st) {
if (functionsHaveNames) {
st.equal(getName(genFn), genFn.name, 'generator function name matches');
if (genFn.concise) {
st.equal(getName(genFn.concise), genFn.concise.name, 'concise generator function name matches');
} else {
st.skip('concise generator functions not supported');
}
}
st.equal(getName(genFn), '', 'generator function has correct name');
if (genFn.concise) {
st.equal(getName(genFn.concise), 'gen', 'concise generator function has correct name');
} else {
st.skip('concise generator functions not supported');
}
t.test('generators', { skip: generators.length === 0 }, function (st) {
st.equal(true, functionsHaveNames, 'functions have names in any env with generator functions');
forEach(generators, function (genFn) {
st.equal(getName(genFn), genFn.name, 'generator function name matches for ' + genFn);
});
st.end();
});
t.test('asyncs', { skip: asyncs.length === 0 }, function (st) {
st.equal(true, functionsHaveNames, 'functions have names in any env with async functions');
forEach(asyncs, function (asyncFn) {
st.equal(getName(asyncFn), asyncFn.name, 'async function name matches for ' + asyncFn);
});
st.end();
});
t.test('Function.prototype.name', function (st) {

@@ -53,0 +53,0 @@ st.equal(getName(function before() {}), 'before', 'function prior to accessing Function.prototype has the right name');

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc