Skip to content

Commit 57dd86a

Browse files
committed
fix URLSearchParams#size in ES3 engines (IE8-)
1 parent 63fbc1b commit 57dd86a

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
- Added `value` argument of `URLSearchParams.prototype.{ has, delete }`, [url/735](https://github.com/whatwg/url/pull/735)
2828
- Fixed some cases of increasing buffer size in `ArrayBuffer.prototype.{ transfer, transferToFixedLength }` polyfills
2929
- Fixed awaiting async `AsyncDisposableStack.prototype.adopt` callback, [#1258](https://github.com/zloirock/core-js/issues/1258)
30+
- Fixed `URLSearchParams#size` in ES3 engines (IE8-)
3031
- Added TypeScript definitions to `core-js-compat`, [#1235](https://github.com/zloirock/core-js/issues/1235), thanks [@susnux](https://github.com/susnux)
3132
- Compat data improvements:
3233
- [`Set.prototype.difference`](https://github.com/tc39/proposal-set-methods) that was missed in Bun because of [a bug](https://github.com/oven-sh/bun/issues/2309) added in 0.6.0

packages/core-js/modules/web.url-search-params.constructor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
205205
anInstance(this, URLSearchParamsPrototype);
206206
var init = arguments.length > 0 ? arguments[0] : undefined;
207207
var state = setInternalState(this, new URLSearchParamsState(init));
208-
if (!DESCRIPTORS) this.length = state.entries.length;
208+
if (!DESCRIPTORS) this.size = state.entries.length;
209209
};
210210

211211
var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
@@ -237,7 +237,7 @@ defineBuiltIns(URLSearchParamsPrototype, {
237237
if (value !== undefined) break;
238238
} else index++;
239239
}
240-
if (!DESCRIPTORS) this.length = entries.length;
240+
if (!DESCRIPTORS) this.size = entries.length;
241241
state.updateURL();
242242
},
243243
// `URLSearchParams.prototype.get` method
@@ -302,7 +302,7 @@ defineBuiltIns(URLSearchParamsPrototype, {
302302
}
303303
}
304304
if (!found) push(entries, { key: key, value: val });
305-
if (!DESCRIPTORS) this.length = entries.length;
305+
if (!DESCRIPTORS) this.size = entries.length;
306306
state.updateURL();
307307
},
308308
// `URLSearchParams.prototype.sort` method

0 commit comments

Comments
 (0)