esnext.set.is-disjoint-from.js 720 B

123456789101112131415161718
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var IS_PURE = require('../internals/is-pure');
  4. var anObject = require('../internals/an-object');
  5. var aFunction = require('../internals/a-function');
  6. var iterate = require('../internals/iterate');
  7. // `Set.prototype.isDisjointFrom` method
  8. // https://tc39.github.io/proposal-set-methods/#Set.prototype.isDisjointFrom
  9. $({ target: 'Set', proto: true, real: true, forced: IS_PURE }, {
  10. isDisjointFrom: function isDisjointFrom(iterable) {
  11. var set = anObject(this);
  12. var hasCheck = aFunction(set.has);
  13. return !iterate(iterable, function (value, stop) {
  14. if (hasCheck.call(set, value) === true) return stop();
  15. }, { INTERRUPTED: true }).stopped;
  16. }
  17. });