Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"use strict";
const whatwgURL = require("whatwg-url-compat");
const documentBaseURL = require("../living/helpers/document-base-url").documentBaseURL;
const notImplemented = require("./not-implemented");
const URL = whatwgURL.createURLConstructor();
module.exports = Location;
const document = Symbol("relevant document");
const oldParsedURL = Symbol("old parsed URL");
function Location(urlString, relevantDocument) {
this[document] = relevantDocument;
whatwgURL.setTheInput(this, urlString);
try {
this[oldParsedURL] = new URL(urlString);
} catch (e) {
this[oldParsedURL] = {};
}
}