Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1767ef0

Browse filesBrowse files
ConnormihaMylesBorins
authored andcommitted
url: simplify constructor URLSearchParams. Remove needless check null
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>
1 parent b5073a0 commit 1767ef0
Copy full SHA for 1767ef0

File tree

Expand file treeCollapse file tree

1 file changed

+1
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-2
lines changed
Open diff view settings
Collapse file

‎lib/internal/url.js‎

Copy file name to clipboardExpand all lines: lib/internal/url.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ class URLSearchParams {
9898
constructor(init = undefined) {
9999
if (init === null || init === undefined) {
100100
this[searchParams] = [];
101-
} else if ((typeof init === 'object' && init !== null) ||
102-
typeof init === 'function') {
101+
} else if (typeof init === 'object' || typeof init === 'function') {
103102
const method = init[Symbol.iterator];
104103
if (method === this[Symbol.iterator]) {
105104
// While the spec does not have this branch, we can use it as a

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.