Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
URL: Don't require ES6 to construct from another URLSearchParams inst…
Browse files Browse the repository at this point in the history
…ance. Resolves #125
  • Loading branch information
inexorabletash committed Feb 21, 2017
1 parent 50b9f49 commit c992f7c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -5377,6 +5377,9 @@ function __cons(t, a) {

if (init === undefined || init === null) {
// no-op
} else if (init instanceof URLSearchParams) {
// In ES6 init would be a sequence, but special case for ES5.
this._list = urlencoded_parse(String(init));
} else if (typeof init === 'object' && isSequence(init)) {
toArray(init).forEach(function(e) {
if (!isSequence(e)) throw TypeError();
Expand Down
4 changes: 2 additions & 2 deletions polyfill.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions url.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@

if (init === undefined || init === null) {
// no-op
} else if (init instanceof URLSearchParams) {
// In ES6 init would be a sequence, but special case for ES5.
this._list = urlencoded_parse(String(init));
} else if (typeof init === 'object' && isSequence(init)) {
toArray(init).forEach(function(e) {
if (!isSequence(e)) throw TypeError();
Expand Down
3 changes: 3 additions & 0 deletions web.js
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,9 @@

if (init === undefined || init === null) {
// no-op
} else if (init instanceof URLSearchParams) {
// In ES6 init would be a sequence, but special case for ES5.
this._list = urlencoded_parse(String(init));
} else if (typeof init === 'object' && isSequence(init)) {
toArray(init).forEach(function(e) {
if (!isSequence(e)) throw TypeError();
Expand Down
2 changes: 1 addition & 1 deletion web.min.js

Large diffs are not rendered by default.

0 comments on commit c992f7c

Please sign in to comment.