(input, base = undefined, parseSymbol = undefined)
| 822 | } |
| 823 | |
| 824 | constructor(input, base = undefined, parseSymbol = undefined) { |
| 825 | markTransferMode(this, false, false); |
| 826 | |
| 827 | if (arguments.length === 0) { |
| 828 | throw new ERR_MISSING_ARGS('url'); |
| 829 | } |
| 830 | |
| 831 | // StringPrototypeToWellFormed is not needed. |
| 832 | input = `${input}`; |
| 833 | |
| 834 | if (base !== undefined) { |
| 835 | base = `${base}`; |
| 836 | } |
| 837 | |
| 838 | let href; |
| 839 | if (arguments.length < 3) { |
| 840 | href = bindingUrl.parse(input, base, true); |
| 841 | } else { |
| 842 | const raiseException = parseSymbol !== kParseURLSymbol; |
| 843 | const interpretAsWindowsPath = parseSymbol === kCreateURLFromWindowsPathSymbol; |
| 844 | const pathToFileURL = interpretAsWindowsPath || (parseSymbol === kCreateURLFromPosixPathSymbol); |
| 845 | href = pathToFileURL ? |
| 846 | bindingUrl.pathToFileURL(input, interpretAsWindowsPath, base) : |
| 847 | bindingUrl.parse(input, base, raiseException); |
| 848 | } |
| 849 | if (href) { |
| 850 | this.#updateContext(href); |
| 851 | } |
| 852 | } |
| 853 | |
| 854 | static parse(input, base = undefined) { |
| 855 | if (arguments.length === 0) { |
nothing calls this directly
no test coverage detected