Skip to content

Commit

Permalink
url: simplify constructor URLSearchParams. Remove needless check null
Browse files Browse the repository at this point in the history
PR-URL: #18700
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
Connormiha authored and MylesBorins committed Feb 21, 2018
1 parent b5073a0 commit 1767ef0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/internal/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ class URLSearchParams {
constructor(init = undefined) {
if (init === null || init === undefined) {
this[searchParams] = [];
} else if ((typeof init === 'object' && init !== null) ||
typeof init === 'function') {
} else if (typeof init === 'object' || typeof init === 'function') {
const method = init[Symbol.iterator];
if (method === this[Symbol.iterator]) {
// While the spec does not have this branch, we can use it as a
Expand Down

0 comments on commit 1767ef0

Please sign in to comment.