is-implemented.js 335 B

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