index.js 588 B

12345678910111213141516171819202122
  1. 'use strict';
  2. var $defineProperty = require('es-define-property');
  3. var hasPropertyDescriptors = function hasPropertyDescriptors() {
  4. return !!$defineProperty;
  5. };
  6. hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
  7. // node v0.6 has a bug where array lengths can be Set but not Defined
  8. if (!$defineProperty) {
  9. return null;
  10. }
  11. try {
  12. return $defineProperty([], 'length', { value: 1 }).length !== 1;
  13. } catch (e) {
  14. // In Firefox 4-22, defining length on an array throws an exception.
  15. return true;
  16. }
  17. };
  18. module.exports = hasPropertyDescriptors;