Skip to content

Commit

Permalink
[patch] "arrow function" should not be capitalized; "Generator functi…
Browse files Browse the repository at this point in the history
…on" is the proper term
  • Loading branch information
ljharb committed May 7, 2021
1 parent 297b810 commit 4fa31c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/why.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ test('functions', function (t) {
var genFnSpaceStar = Function('return function *() {};')();
var genNoSpaces = Function('return function*(){};')();
var reasonsMap = {
'second argument is a Generator; first is not': true,
'second argument is a Generator function; first is not': true,
'toStringTag is not the same: [object Function] !== [object GeneratorFunction]': true
};
var reasons = objectEntries(reasonsMap);
Expand All @@ -395,7 +395,7 @@ test('functions', function (t) {
t.test('arrow functions', { skip: !hasArrowFunctionSupport }, function (st) {
forEach(arrowFunctions, function (fn) {
st.equal(
'second argument is an Arrow function; first is not',
'second argument is an arrow function; first is not',
isEqualWhy(fnNoSpace, fn),
fn + ' not equal to ' + fnNoSpace
);
Expand Down
8 changes: 4 additions & 4 deletions why.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,15 @@ module.exports = function whyNotEqual(value, other) {
var valueIsGen = isGenerator(value);
var otherIsGen = isGenerator(other);
if (valueIsGen !== otherIsGen) {
if (valueIsGen) { return 'first argument is a Generator; second is not'; }
return 'second argument is a Generator; first is not';
if (valueIsGen) { return 'first argument is a Generator function; second is not'; }
return 'second argument is a Generator function; first is not';
}

var valueIsArrow = isArrowFunction(value);
var otherIsArrow = isArrowFunction(other);
if (valueIsArrow !== otherIsArrow) {
if (valueIsArrow) { return 'first argument is an Arrow function; second is not'; }
return 'second argument is an Arrow function; first is not';
if (valueIsArrow) { return 'first argument is an arrow function; second is not'; }
return 'second argument is an arrow function; first is not';
}

if (isCallable(value) || isCallable(other)) {
Expand Down

0 comments on commit 4fa31c7

Please sign in to comment.