-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use ES6 syntax #156
use ES6 syntax #156
Conversation
|
||
'use strict'; | ||
|
||
/* istanbul ignore if */ | ||
if (typeof __doctest !== 'undefined') { | ||
/* eslint-disable no-unused-vars */ | ||
/* eslint-disable no-unused-vars, no-var */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I never thought to use var
as a feature. :)
index.js
Outdated
var functionName = has ('name', Function) ? | ||
function functionName(f) { return f.name; } : | ||
const functionName = ( | ||
has ('name', Function) ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need to consider the fallback for function names? Wasn't that an es5-support thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! You are correct: ECMAScript 2015 Language Specification § 19.2.4.2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#142 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, and depending on the outcome of this #151 (comment) discussion, we may end up removing the functionName
function altogether.
3ce67d5
to
db087cc
Compare
sanctuary-js/sanctuary#687