Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 77d8ae1

Browse files
realitykingpkozlowski-opensource
authored andcommitted
refactor($location) Remove unused variables
These were left around in 736c8fb Closes #9482
1 parent e21b6ff commit 77d8ae1

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/ng/location.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ function encodePath(path) {
2222
return segments.join('/');
2323
}
2424

25-
function parseAbsoluteUrl(absoluteUrl, locationObj, appBase) {
26-
var parsedUrl = urlResolve(absoluteUrl, appBase);
25+
function parseAbsoluteUrl(absoluteUrl, locationObj) {
26+
var parsedUrl = urlResolve(absoluteUrl);
2727

2828
locationObj.$$protocol = parsedUrl.protocol;
2929
locationObj.$$host = parsedUrl.hostname;
3030
locationObj.$$port = int(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null;
3131
}
3232

3333

34-
function parseAppUrl(relativeUrl, locationObj, appBase) {
34+
function parseAppUrl(relativeUrl, locationObj) {
3535
var prefixed = (relativeUrl.charAt(0) !== '/');
3636
if (prefixed) {
3737
relativeUrl = '/' + relativeUrl;
3838
}
39-
var match = urlResolve(relativeUrl, appBase);
39+
var match = urlResolve(relativeUrl);
4040
locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ?
4141
match.pathname.substring(1) : match.pathname);
4242
locationObj.$$search = parseKeyValue(match.search);
@@ -91,7 +91,7 @@ function LocationHtml5Url(appBase, basePrefix) {
9191
this.$$html5 = true;
9292
basePrefix = basePrefix || '';
9393
var appBaseNoFile = stripFile(appBase);
94-
parseAbsoluteUrl(appBase, this, appBase);
94+
parseAbsoluteUrl(appBase, this);
9595

9696

9797
/**
@@ -106,7 +106,7 @@ function LocationHtml5Url(appBase, basePrefix) {
106106
appBaseNoFile);
107107
}
108108

109-
parseAppUrl(pathUrl, this, appBase);
109+
parseAppUrl(pathUrl, this);
110110

111111
if (!this.$$path) {
112112
this.$$path = '/';
@@ -169,7 +169,7 @@ function LocationHtml5Url(appBase, basePrefix) {
169169
function LocationHashbangUrl(appBase, hashPrefix) {
170170
var appBaseNoFile = stripFile(appBase);
171171

172-
parseAbsoluteUrl(appBase, this, appBase);
172+
parseAbsoluteUrl(appBase, this);
173173

174174

175175
/**
@@ -189,7 +189,7 @@ function LocationHashbangUrl(appBase, hashPrefix) {
189189
throw $locationMinErr('ihshprfx', 'Invalid url "{0}", missing hash prefix "{1}".', url,
190190
hashPrefix);
191191
}
192-
parseAppUrl(withoutHashUrl, this, appBase);
192+
parseAppUrl(withoutHashUrl, this);
193193

194194
this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase);
195195

src/ng/urlUtils.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// exactly the behavior needed here. There is little value is mocking these out for this
88
// service.
99
var urlParsingNode = document.createElement("a");
10-
var originUrl = urlResolve(window.location.href, true);
10+
var originUrl = urlResolve(window.location.href);
1111

1212

1313
/**
@@ -62,7 +62,7 @@ var originUrl = urlResolve(window.location.href, true);
6262
* | pathname | The pathname, beginning with "/"
6363
*
6464
*/
65-
function urlResolve(url, base) {
65+
function urlResolve(url) {
6666
var href = url;
6767

6868
if (msie) {

test/ng/urlUtilsSpec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ describe('urlUtils', function() {
2727
it('should support various combinations of urls - both string and parsed', inject(function($document) {
2828
function expectIsSameOrigin(url, expectedValue) {
2929
expect(urlIsSameOrigin(url)).toBe(expectedValue);
30-
expect(urlIsSameOrigin(urlResolve(url, true))).toBe(expectedValue);
30+
expect(urlIsSameOrigin(urlResolve(url))).toBe(expectedValue);
3131
}
3232
expectIsSameOrigin('path', true);
33-
var origin = urlResolve($document[0].location.href, true);
33+
var origin = urlResolve($document[0].location.href);
3434
expectIsSameOrigin('//' + origin.host + '/path', true);
3535
// Different domain.
3636
expectIsSameOrigin('http://example.com/path', false);

0 commit comments

Comments
 (0)