shimmed.js 802 B

12345678910111213141516171819202122232425262728
  1. 'use strict';
  2. require('../auto');
  3. var runTests = require('./tests');
  4. var test = require('tape');
  5. var defineProperties = require('define-properties');
  6. var callBind = require('call-bind');
  7. var isEnumerable = Object.prototype.propertyIsEnumerable;
  8. var functionsHaveNames = require('functions-have-names')();
  9. test('shimmed', function (t) {
  10. t.equal(Object.is.length, 2, 'Object.is has a length of 2');
  11. t.test('Function name', { skip: !functionsHaveNames }, function (st) {
  12. st.equal(Object.is.name, 'is', 'Object.is has name "is"');
  13. st.end();
  14. });
  15. t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
  16. et.equal(false, isEnumerable.call(Object, 'is'), 'Object.is is not enumerable');
  17. et.end();
  18. });
  19. runTests(callBind(Object.is, Object), t);
  20. t.end();
  21. });