node: add the 3rd parameter to URLSearchParams.forEach (#27732)

The documentation for [URLSearchParams.forEach][1] shows that the
callback function will be called with 3 parameters. This has been true
since Node 6. This commit adds a definition for the 3rd parameter to
the definition files for Node 6, 7, 8, 9 and 10.

[1]: https://nodejs.org/api/url.html#url_urlsearchparams_foreach_fn_thisarg
This commit is contained in:
Louis-Dominique Dubeau
2018-07-31 18:43:02 -04:00
committed by Sheetal Nandi
parent 9a41d9b636
commit e425a450ce
10 changed files with 15 additions and 10 deletions

View File

@@ -690,9 +690,10 @@ namespace url_tests {
const searchParams = new url.URLSearchParams('abc=123');
assert.equal(searchParams.toString(), 'abc=123');
searchParams.forEach((value: string, name: string): void => {
searchParams.forEach((value: string, name: string, me: url.URLSearchParams): void => {
assert.equal(name, 'abc');
assert.equal(value, '123');
assert.equal(me, searchParams);
});
assert.equal(searchParams.get('abc'), '123');