9390d93d988bbf6bfb576b463e79cda6881a67dd5535dac3b9abd48b9bf335aaa2170b5b3bd4a75b69ba2da2875d21ba9a6a4d651e78369f0756eb2a06749f 713 B

123456789101112131415161718192021
  1. 'use strict';
  2. var DESCRIPTORS = require('../internals/descriptors');
  3. var uncurryThis = require('../internals/function-uncurry-this');
  4. var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
  5. var URLSearchParamsPrototype = URLSearchParams.prototype;
  6. var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
  7. // `URLSearchParams.prototype.size` getter
  8. // https://github.com/whatwg/url/pull/734
  9. if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) {
  10. defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {
  11. get: function size() {
  12. var count = 0;
  13. forEach(this, function () { count++; });
  14. return count;
  15. },
  16. configurable: true,
  17. enumerable: true
  18. });
  19. }