opencode/packages/codemode-rust/conformance/cases/std-readonly-accessors.js
kommander aa0cd870b4 feat(codemode): add URL, URLSearchParams, Headers, crypto and structuredClone
URL with its readable and writable fields and a linked searchParams,
URL.canParse/parse; URLSearchParams from strings, records, pairs and
other params, with live iterators; Headers with name and value
validation, combined values and set-cookie kept apart in the host's
order; crypto.randomUUID and getRandomValues from /dev/urandom; and
structuredClone over the data kinds, rejecting the rest with
DataCloneError. Writing a read-only accessor (RegExp flags, Uint8Array
length, size, TextDecoder fields, URL origin) throws the reference's
TypeError.

Adds the url crate (pure Rust WHATWG URL parser) with idna_adapter pinned
to 1.1, which maps IDNA with the unicode-rs crates instead of ICU4X; the
stripped embed example grows from 3512936 to 3879376 bytes.

Built-in iterators over URLSearchParams and Headers report the reference's tags.
2026-11-18 18:56:09 +01:00

4 lines
421 B
JavaScript

const r = []
for (const f of [() => { /x/.source = 1 }, () => { new Uint8Array(1).length = 3 }, () => { new URLSearchParams().size = 3 }, () => { new TextDecoder().encoding = "x" }, () => { /x/.lastIndex = 2; return 1 }]) { try { r.push(f()) } catch (e) { r.push(e.message) } }
for (const f of [() => { new Map().size = 1 }, () => { new Set().size = 1 }]) { try { r.push(f()) } catch (e) { r.push(e.message) } }
return r