Skip to content

Commit

Permalink
fixup! Add two polyfills for nextElementSibling and previousElementSi…
Browse files Browse the repository at this point in the history
…bling
  • Loading branch information
aliuk2012 committed May 17, 2019
1 parent b5cf231 commit bac50bf
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
17 changes: 0 additions & 17 deletions src/vendor/polyfills/Element/prototype/nextElementSibling.js
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down
18 changes: 0 additions & 18 deletions src/vendor/polyfills/Element/prototype/previousElementSibling.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down

0 comments on commit bac50bf

Please sign in to comment.