From 2b168541dcf2656623f4cd26581701fe524f2255 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Thu, 7 Sep 2017 08:54:35 -0700 Subject: [PATCH] restrict globals that are permitted for linting (#1077) --- .eslintrc | 1 + src/utils/extend-selection.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index e78569c57..51500e589 100644 --- a/.eslintrc +++ b/.eslintrc @@ -79,6 +79,7 @@ "no-path-concat": "error", "no-redeclare": "error", "no-regex-spaces": "error", + "no-restricted-globals": ["error", "Debug", "Document", "event", "history", "History", "length", "Map", "Node", "parent", "Range", "Selection", "Set", "Text"], "no-sequences": "error", "no-shadow": "error", "no-shadow-restricted-names": "error", diff --git a/src/utils/extend-selection.js b/src/utils/extend-selection.js index 00dfaa2c6..d5012fa90 100644 --- a/src/utils/extend-selection.js +++ b/src/utils/extend-selection.js @@ -25,7 +25,7 @@ function extendSelection(selection, el, offset) { anchor.setStart(selection.anchorNode, selection.anchorOffset) focus.setStart(el, offset) - const v = focus.compareBoundaryPoints(Range.START_TO_START, anchor) + const v = focus.compareBoundaryPoints(window.Range.START_TO_START, anchor) // If the focus is after the anchor... if (v >= 0) {