main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 2 weeks ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
713 bytes
|
Line | |
---|
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 | // `URLSearchParams.prototype.size` getter
|
---|
10 | // https://github.com/whatwg/url/pull/734
|
---|
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 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.