a-weak-set.js 341 B

12345678910
  1. 'use strict';
  2. var tryToString = require('../internals/try-to-string');
  3. var $TypeError = TypeError;
  4. // Perform ? RequireInternalSlot(M, [[WeakSetData]])
  5. module.exports = function (it) {
  6. if (typeof it == 'object' && 'has' in it && 'add' in it && 'delete' in it) return it;
  7. throw new $TypeError(tryToString(it) + ' is not a weakset');
  8. };