a-weak-map.js 350 B

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