Skip to content

Commit

Permalink
move some logic to the prototype of URL state
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Nov 28, 2021
1 parent c4e8bb3 commit 52eea94
Show file tree
Hide file tree
Showing 3 changed files with 612 additions and 597 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Added a workaround for a UC Browser specific version bug with unobservable `RegExp#sticky` flag, [#1008](https://github.com/zloirock/core-js/issues/1008), [#1015](https://github.com/zloirock/core-js/issues/1015)
- Added handling of comments and specific spaces to `Function#name` polyfill, [#1010](https://github.com/zloirock/core-js/issues/1010), thanks [@ildar-shaimordanov](https://github.com/ildar-shaimordanov)
- Prevented some theoretical cases of breaking / observing the internal state by patching `Array.prototype[@@species]`
- Refactored `URL` and `URLSearchParams`
- Added iOS Safari 15.2 compat data mapping
- Added Electron 17.0 compat data mapping
- Updated Deno compat data mapping
Expand Down
5 changes: 3 additions & 2 deletions packages/core-js/modules/web.url-search-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ URLSearchParamsState.prototype = {
type: URL_SEARCH_PARAMS,
bindURL: function (url) {
this.url = url;
this.update();
},
parseObject: function (object) {
var iteratorMethod = getIteratorMethod(object);
Expand Down Expand Up @@ -172,7 +173,7 @@ URLSearchParamsState.prototype = {
}
}
},
toString: function () {
serialize: function () {
var entries = this.entries;
var result = [];
var index = 0;
Expand Down Expand Up @@ -325,7 +326,7 @@ redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries, {
// `URLSearchParams.prototype.toString` method
// https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
redefine(URLSearchParamsPrototype, 'toString', function toString() {
return getInternalParamsState(this).toString();
return getInternalParamsState(this).serialize();
}, { enumerable: true });

setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
Expand Down
Loading

0 comments on commit 52eea94

Please sign in to comment.