Skip to content

Commit c4e0920

Browse files
committedApr 23, 2022
Parenthesize remaining mixed expressions of && and || (#2949)
These expressions are nonambiguous because the && operator comes first, but eslint does not care about the order and always requires parens. I decided to go with the flow and just add those parens.
1 parent ad93ed5 commit c4e0920

8 files changed

+11
-11
lines changed
 

‎modules/_collectNonEnumProps.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default function collectNonEnumProps(obj, keys) {
2525
keys = emulatedSet(keys);
2626
var nonEnumIdx = nonEnumerableProps.length;
2727
var constructor = obj.constructor;
28-
var proto = isFunction(constructor) && constructor.prototype || ObjProto;
28+
var proto = (isFunction(constructor) && constructor.prototype) || ObjProto;
2929

3030
// Constructor is a special case.
3131
var prop = 'constructor';

‎modules/unzip.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import pluck from './pluck.js';
55
// Complement of zip. Unzip accepts an array of arrays and groups
66
// each array's elements on shared indices.
77
export default function unzip(array) {
8-
var length = array && max(array, getLength).length || 0;
8+
var length = (array && max(array, getLength).length) || 0;
99
var result = Array(length);
1010

1111
for (var index = 0; index < length; index++) {

‎underscore-esm.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎underscore-esm.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎underscore-node-f.cjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ function collectNonEnumProps(obj, keys) {
257257
keys = emulatedSet(keys);
258258
var nonEnumIdx = nonEnumerableProps.length;
259259
var constructor = obj.constructor;
260-
var proto = isFunction$1(constructor) && constructor.prototype || ObjProto;
260+
var proto = (isFunction$1(constructor) && constructor.prototype) || ObjProto;
261261

262262
// Constructor is a special case.
263263
var prop = 'constructor';
@@ -1765,7 +1765,7 @@ function intersection(array) {
17651765
// Complement of zip. Unzip accepts an array of arrays and groups
17661766
// each array's elements on shared indices.
17671767
function unzip(array) {
1768-
var length = array && max(array, getLength).length || 0;
1768+
var length = (array && max(array, getLength).length) || 0;
17691769
var result = Array(length);
17701770

17711771
for (var index = 0; index < length; index++) {

‎underscore-node-f.cjs.map

+1-1
Large diffs are not rendered by default.

‎underscore-umd.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎underscore-umd.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.