* @param {string | URL} url * @param {string | URL} [base]
(url, base)
| 55 | * @param {string | URL} [base] |
| 56 | */ |
| 57 | constructor(url, base) { |
| 58 | url = new URL(url, base); |
| 59 | super(url); |
| 60 | |
| 61 | if (DEV) { |
| 62 | tag(this.#protocol, 'SvelteURL.protocol'); |
| 63 | tag(this.#username, 'SvelteURL.username'); |
| 64 | tag(this.#password, 'SvelteURL.password'); |
| 65 | tag(this.#hostname, 'SvelteURL.hostname'); |
| 66 | tag(this.#port, 'SvelteURL.port'); |
| 67 | tag(this.#pathname, 'SvelteURL.pathname'); |
| 68 | tag(this.#hash, 'SvelteURL.hash'); |
| 69 | tag(this.#search, 'SvelteURL.search'); |
| 70 | } |
| 71 | |
| 72 | current_url = this; |
| 73 | this.#searchParams = new SvelteURLSearchParams(url.searchParams); |
| 74 | current_url = null; |
| 75 | } |
| 76 | |
| 77 | get hash() { |
| 78 | return get(this.#hash); |