From 5532e879ebeaae474cff65934d937444bc2daaf4 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Fri, 27 May 2016 10:38:41 -0700 Subject: [PATCH] Check for infinity with == in scrollbar --- core/scrollbar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/scrollbar.js b/core/scrollbar.js index 86b52a339..ee080b0bc 100644 --- a/core/scrollbar.js +++ b/core/scrollbar.js @@ -454,7 +454,7 @@ Blockly.Scrollbar.prototype.resizeContentHorizontal = function(hostMetrics) { } this.ratio_ = this.scrollViewSize_ / hostMetrics.contentWidth; - if (this.ratio_ === -Infinity || this.ratio_ === Infinity || + if (this.ratio_ == -Infinity || this.ratio_ == Infinity || isNaN(this.ratio_)) { this.ratio_ = 0; } @@ -519,7 +519,7 @@ Blockly.Scrollbar.prototype.resizeContentVertical = function(hostMetrics) { } this.ratio_ = this.scrollViewSize_ / hostMetrics.contentHeight; - if (this.ratio_ === -Infinity || this.ratio_ === Infinity || + if (this.ratio_ == -Infinity || this.ratio_ == Infinity || isNaN(this.ratio_)) { this.ratio_ = 0; }