Summary
The static URL lowering supports protocol, pathname, href, host, hostname, search, searchParams and toString() (per the compiler hint), but port and hash are not-implemented in node-v24-internal.json. Both are needed to validate that a URL is exactly <scheme>://<host>[:port]/<path> with no fragment, which is a typical allow-list check for loopback broker or callback URLs.
Reproduction
// url.ts
const url = new URL("https://example.com:8443/path#frag");
console.log(url.port, url.hash);
$ node --experimental-strip-types url.ts
8443 #frag
$ scriptc build -o /tmp/r url.ts
url.ts:2:13 - error SC2020: 'URL.port' is typed by @types/node but has no scriptc lowering yet
1 error.
With url.port removed the same file reports 'URL.hash' is typed by @types/node but has no scriptc lowering yet. Without a tsconfig.json the ambient URL type lacks both properties (Property 'port' does not exist on type 'URL').
Expected
WHATWG semantics as in Node: port is "" when the port is the scheme default or absent, otherwise the decimal string; hash is "" when there is no fragment, otherwise "#" plus the fragment. Read-only getters are sufficient for my use; setters are a separate ask.
Tier
Static. I have not checked whether the dynamic island exposes them; the request is for the static lowering only.
Related
Open PR #249 adds a URL.port getter extraction; URL.hash is not covered there.
Summary
The static
URLlowering supportsprotocol,pathname,href,host,hostname,search,searchParamsandtoString()(per the compiler hint), butportandhasharenot-implementedinnode-v24-internal.json. Both are needed to validate that a URL is exactly<scheme>://<host>[:port]/<path>with no fragment, which is a typical allow-list check for loopback broker or callback URLs.Reproduction
With
url.portremoved the same file reports'URL.hash' is typed by @types/node but has no scriptc lowering yet. Without atsconfig.jsonthe ambientURLtype lacks both properties (Property 'port' does not exist on type 'URL').Expected
WHATWG semantics as in Node:
portis""when the port is the scheme default or absent, otherwise the decimal string;hashis""when there is no fragment, otherwise"#"plus the fragment. Read-only getters are sufficient for my use; setters are a separate ask.Tier
Static. I have not checked whether the dynamic island exposes them; the request is for the static lowering only.
Related
Open PR #249 adds a
URL.portgetter extraction;URL.hashis not covered there.