MCPcopy Index your code
hub / github.com/ampproject/amphtml / parseUrl

Function parseUrl

third_party/subscriptions-project/swg.js:5305–5319  ·  view source on GitHub ↗

* Returns a Location-like object for the given URL. If it is relative, * the URL gets resolved. * Consider the returned object immutable. This is enforced during * testing by freezing the object. * @param {string} url * @return {!LocationDef}

(url)

Source from the content-addressed store, hash-verified

5303 * @return {!LocationDef}
5304 */
5305function parseUrl(url) {
5306 if (!a) {
5307 a = /** @type {!HTMLAnchorElement} */ (self.document.createElement('a'));
5308 cache = self.UrlCache || (self.UrlCache = Object.create(null));
5309 }
5310
5311 const fromCache = cache[url];
5312 if (fromCache) {
5313 return fromCache;
5314 }
5315
5316 const info = parseUrlWithA(a, url);
5317
5318 return (cache[url] = info);
5319}
5320
5321/**
5322 * Returns a Location-like object for the given URL. If it is relative,

Callers 6

swg.jsFile · 0.70
feOriginFunction · 0.70
startMethod · 0.70
setStaticContext_Method · 0.70
startMethod · 0.70
fetchMethod · 0.70

Calls 2

parseUrlWithAFunction · 0.70
createMethod · 0.45

Tested by

no test coverage detected