'use strict'; var define = require('define-properties'); var getPolyfill = require('./polyfill'); module.exports = function shimContains() { var polyfill = getPolyfill(); if (typeof document !== 'undefined') { define( document, { contains: polyfill }, { contains: function () { return document.contains !== polyfill; } } ); if (typeof Element !== 'undefined') { define( Element.prototype, { contains: polyfill }, { contains: function () { return Element.prototype.contains !== polyfill; } } ); } } return polyfill; };