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 |
|
6 | var URLSearchParamsPrototype = URLSearchParams.prototype;
|
7 | var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
|
8 |
|
9 |
|
10 |
|
11 | if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) {
|
12 | defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {
|
13 | get: function size() {
|
14 | var count = 0;
|
15 | forEach(this, function () { count++; });
|
16 | return count;
|
17 | },
|
18 | configurable: true,
|
19 | enumerable: true
|
20 | });
|
21 | }
|