esnext.weak-set.add-all.js 513 B

123456789101112131415
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var aWeakSet = require('../internals/a-weak-set');
  4. var add = require('../internals/weak-set-helpers').add;
  5. // `WeakSet.prototype.addAll` method
  6. // https://github.com/tc39/proposal-collection-methods
  7. $({ target: 'WeakSet', proto: true, real: true, forced: true }, {
  8. addAll: function addAll(/* ...elements */) {
  9. var set = aWeakSet(this);
  10. for (var k = 0, len = arguments.length; k < len; k++) {
  11. add(set, arguments[k]);
  12. } return set;
  13. }
  14. });