From bac50bf4ed867e20973ed78bc42d79c096636653 Mon Sep 17 00:00:00 2001 From: Alistair Laing Date: Fri, 17 May 2019 15:56:02 +0100 Subject: [PATCH] fixup! Add two polyfills for nextElementSibling and previousElementSibling --- .../Element/prototype/nextElementSibling.js | 17 ----------------- .../prototype/previousElementSibling.js | 18 ------------------ 2 files changed, 35 deletions(-) diff --git a/src/vendor/polyfills/Element/prototype/nextElementSibling.js b/src/vendor/polyfills/Element/prototype/nextElementSibling.js index 1447df2593..ec3c615496 100644 --- a/src/vendor/polyfills/Element/prototype/nextElementSibling.js +++ b/src/vendor/polyfills/Element/prototype/nextElementSibling.js @@ -12,23 +12,6 @@ import '../../Element' (function (global) { - var dpSupport = true; - var defineGetter = function (object, name, fn, configurable) { - if (Object.defineProperty) - Object.defineProperty(object, name, { - configurable: false === dpSupport ? true : !!configurable, - get: fn - }); - - else object.__defineGetter__(name, fn); - }; - /** Ensure the browser allows Object.defineProperty to be used on native JavaScript objects. */ - try { - defineGetter({}, "support"); - } - catch (e) { - dpSupport = false; - } // Polyfill from https://github.com/Financial-Times/polyfill-service/pull/1062/files#diff-404b69b4750d18dea4174930a49170fd Object.defineProperty(Element.prototype, "nextElementSibling", { diff --git a/src/vendor/polyfills/Element/prototype/previousElementSibling.js b/src/vendor/polyfills/Element/prototype/previousElementSibling.js index 1f3e73728a..1184a0a3e3 100644 --- a/src/vendor/polyfills/Element/prototype/previousElementSibling.js +++ b/src/vendor/polyfills/Element/prototype/previousElementSibling.js @@ -11,24 +11,6 @@ import '../../Element' if (detect) return (function (global) { - var dpSupport = true; - var defineGetter = function (object, name, fn, configurable) { - if (Object.defineProperty) - Object.defineProperty(object, name, { - configurable: false === dpSupport ? true : !!configurable, - get: fn - }); - - else object.__defineGetter__(name, fn); - }; - /** Ensure the browser allows Object.defineProperty to be used on native JavaScript objects. */ - try { - defineGetter({}, "support"); - } - catch (e) { - dpSupport = false; - } - // Polyfill from https://github.com/Financial-Times/polyfill-service/pull/1062/files#diff-b45a1197b842728cb76b624b6ba7d739 Object.defineProperty(Element.prototype, 'previousElementSibling', { get: function(){