Skip to content

Commit

Permalink
remove Function.name polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchambers committed Apr 24, 2021
1 parent 950de6e commit 3ce67d5
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,6 @@
// Value :: Location
const Value = 'Value';

// functionName :: Function -> String
const functionName = (
has ('name', Function) ?
f => f.name :
/* istanbul ignore next */
f => {
const match = /function (\w*)/.exec (f);
return match == null ? '' : match[1];
}
);

const getStaticMethod = _name => {
const name = 'fantasy-land/' + _name;
return typeRep => (
Expand Down Expand Up @@ -990,7 +979,7 @@
}

const staticMethod = (name, typeRep) => {
switch (functionName (typeRep) + '.' + name) {
switch (typeRep.name + '.' + name) {
case 'String.fantasy-land/empty':
return String$empty;
case 'Array.fantasy-land/empty':
Expand Down

0 comments on commit 3ce67d5

Please sign in to comment.