Skip to content

Commit 913ce80

Browse files
author
Eugene Kuzmenko
committed
do not use isset to check for variables that might not exist
1 parent 9396bae commit 913ce80

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

dist/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function (_React$Component) {
126126
var noScrollYChanged = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
127127
var noScrollXChanged = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
128128

129-
if (!(0, _utilities.isset)(document) || !_this.content) {
129+
if (typeof document === "undefined" || !_this.content) {
130130
return _assertThisInitialized(_assertThisInitialized(_this));
131131
}
132132

@@ -175,7 +175,7 @@ function (_React$Component) {
175175
});
176176

177177
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "removeListeners", function () {
178-
if (!(0, _utilities.isset)(document) || !_this.content) {
178+
if (typeof document === "undefined" || !_this.content) {
179179
return _assertThisInitialized(_assertThisInitialized(_this));
180180
}
181181

dist/util/utilities.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function getScrollbarWidth() {
2626
return scrollbarWidth;
2727
}
2828

29-
if (!isset(document)) {
29+
if (typeof document === "undefined") {
3030
return scrollbarWidth = 0;
3131
}
3232

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ export default class Scrollbar extends React.Component {
376376
* @return {Scrollbar}
377377
*/
378378
addListeners = (noScrollChanged = false, noScrollYChanged = false, noScrollXChanged = false) => {
379-
if (!isset(document) || !this.content) {
379+
if (typeof document === "undefined" || !this.content) {
380380
return this;
381381
}
382382

@@ -419,7 +419,7 @@ export default class Scrollbar extends React.Component {
419419
* @return {Scrollbar}
420420
*/
421421
removeListeners = () => {
422-
if (!isset(document) || !this.content) {
422+
if (typeof document === "undefined" || !this.content) {
423423
return this;
424424
}
425425

src/util/utilities.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function getScrollbarWidth() {
1818
return scrollbarWidth;
1919
}
2020

21-
if (!isset(document)) {
21+
if (typeof document === "undefined") {
2222
return (scrollbarWidth = 0);
2323
}
2424

0 commit comments

Comments
 (0)