Skip to content

Commit

Permalink
implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jul 23, 2019
1 parent c9e8e09 commit b7b4942
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions index.js
@@ -0,0 +1,5 @@
'use strict';

module.exports = function functionsHaveNames() {
return function f() {}.name === 'f';
};
2 changes: 1 addition & 1 deletion test/index.js
Expand Up @@ -5,7 +5,7 @@ var test = require('tape');
var hasNames = require('../');

test('named functions', function (t) {
function f() {}
function f() {} // eslint-disable-line func-style
var g = function h() {};

t.equal(hasNames(), f.name === 'f' && g.name === 'h', 'functions have names or not as expected');
Expand Down

0 comments on commit b7b4942

Please sign in to comment.