polyfill-service
Version:
A polyfill combinator
27 lines (23 loc) • 809 B
JavaScript
/* eslint-env mocha, browser */
/* global proclaim */
var arePropertyDescriptorsSupported = function () {
var obj = {};
try {
Object.defineProperty(obj, 'x', { enumerable: false, value: obj });
/* eslint-disable no-unused-vars, no-restricted-syntax */
for (var _ in obj) { return false; }
/* eslint-enable no-unused-vars, no-restricted-syntax */
return obj.x === obj;
} catch (e) { // this is IE 8.
return false;
}
};
var supportsDescriptors = Object.defineProperty && arePropertyDescriptorsSupported();
it('has the well known symbol species as static properties on Symbol', function() {
proclaim.notEqual(Symbol.species, undefined);
if (supportsDescriptors) {
var species = Symbol.species;
Symbol.species = "nope";
proclaim.equal(Symbol.species, species);
}
});