Skip to content

Commit c658209

Browse files
committed
test: replace var with const/let in test/parallel/test-whatwg-url-setters.js
Refs: nodejs/code-and-learn#97
1 parent 3a076ba commit c658209

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/parallel/test-whatwg-url-setters.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,22 @@ function startURLSettersTests() {
3737
}
3838

3939
function runURLSettersTests(all_test_cases) {
40-
for (var attribute_to_be_set in all_test_cases) {
40+
for (const attribute_to_be_set in all_test_cases) {
4141
if (attribute_to_be_set == "comment") {
4242
continue;
4343
}
44-
var test_cases = all_test_cases[attribute_to_be_set];
45-
for(var i = 0, l = test_cases.length; i < l; i++) {
46-
var test_case = test_cases[i];
47-
var name = `Setting <${test_case.href}>.${attribute_to_be_set}` +
44+
const test_cases = all_test_cases[attribute_to_be_set];
45+
for(let i = 0, l = test_cases.length; i < l; i++) {
46+
const test_case = test_cases[i];
47+
let name = `Setting <${test_case.href}>.${attribute_to_be_set}` +
4848
` = '${test_case.new_value}'`;
4949
if ("comment" in test_case) {
5050
name += ` ${test_case.comment}`;
5151
}
5252
test(function() {
53-
var url = new URL(test_case.href);
53+
const url = new URL(test_case.href);
5454
url[attribute_to_be_set] = test_case.new_value;
55-
for (var attribute in test_case.expected) {
55+
for (const attribute in test_case.expected) {
5656
assert_equals(url[attribute], test_case.expected[attribute])
5757
}
5858
}, `URL: ${name}`);

0 commit comments

Comments
 (0)