Implement Fetch API backed by net crate
Add fetch() global function that returns a Promise<Response>, backed by
the existing HTTP/1.1 client and TLS implementation in the net crate.
- fetch(url, options?) spawns a background thread for non-blocking I/O
- Response object: status, statusText, ok, url, headers, text(), json()
- Headers object: get(), has(), set(), delete() with case-insensitive matching
- Event loop integration: pending fetches polled alongside timers
- GC roots for pending fetch promises prevent premature collection
- Promise rejects on network errors (DNS failure, connection refused, etc.)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
authored by
tangled.org
981f4d7d
7ebfb8ec