Index: qunit/tests/url.js |
diff --git a/qunit/tests/url.js b/qunit/tests/url.js |
index 1b504cb70d7442a8f5cbfa086266fec9bc19dfaf..6f03f14561349458aa5074b03e54a2e4edd54c62 100644 |
--- a/qunit/tests/url.js |
+++ b/qunit/tests/url.js |
@@ -16,17 +16,16 @@ |
*/ |
-(function() |
{ |
- var url = require("url"); |
- var getDecodedHostname = url.getDecodedHostname; |
- var extractHostFromFrame = url.extractHostFromFrame; |
- var stringifyURL = url.stringifyURL; |
- var isThirdParty = url.isThirdParty; |
+ let url = require("url"); |
+ let getDecodedHostname = url.getDecodedHostname; |
+ let extractHostFromFrame = url.extractHostFromFrame; |
+ let stringifyURL = url.stringifyURL; |
+ let isThirdParty = url.isThirdParty; |
module("URL/host tools"); |
- test("Extracting hostname from URL", function() |
+ test("Extracting hostname from URL", () => |
{ |
function testURLHostname(url, expectedHostname, message) |
{ |
@@ -46,14 +45,14 @@ |
testURLHostname("http://[2001:db8:85a3::8a2e:370:7334]/", "[2001:db8:85a3::8a2e:370:7334]", "IPv6 address"); |
}); |
- test("Extracting hostname from frame", function() |
+ test("Extracting hostname from frame", () => |
{ |
function testFrameHostname(hierarchy, expectedHostname, message) |
{ |
- var frame = null; |
+ let frame = null; |
- for (var i = 0; i < hierarchy.length; i++) |
- frame = {parent: frame, url: new URL(hierarchy[i])}; |
+ for (let url of hierarchy) |
+ frame = {parent: frame, url: new URL(url)}; |
equal(extractHostFromFrame(frame), expectedHostname, message); |
} |
@@ -66,7 +65,7 @@ |
testFrameHostname(["http://xn--f-1gaa.com/"], "f\u00f6\u00f6.com", "with punycode"); |
}); |
- test("Stringifying URLs", function() |
+ test("Stringifying URLs", () => |
{ |
function testNormalizedURL(url, expectedURL, message) |
{ |
@@ -89,7 +88,7 @@ |
testPreservedURL("data:text/plain,foo", "data: URL"); |
}); |
- test("Third-party checks", function() |
+ test("Third-party checks", () => |
{ |
function hostnameToURL(hostname) |
{ |
@@ -134,4 +133,4 @@ |
testThirdParty("xn--f-1gaa.com", "f\u00f6\u00f6.com", false, "same IDN isn't third-party"); |
testThirdParty("example.com..", "example.com....", false, "traling dots are ignored"); |
}); |
-})(); |
+} |