is-implemented.js 320 B

1234567891011121314
  1. 'use strict';
  2. var global = require('es5-ext/global')
  3. , polyfill = require('../polyfill');
  4. module.exports = function (t, a) {
  5. var cache;
  6. a(typeof t(), 'boolean');
  7. cache = global.WeakMap;
  8. global.WeakMap = polyfill;
  9. a(t(), true);
  10. if (cache === undefined) delete global.WeakMap;
  11. else global.WeakMap = cache;
  12. };