Repository navigation
Add opt-in Blob, File and FormData - #3093
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the opt-in web API series (#3079):
Blob,FileandFormDatabehindWebApiFeatures.Files(inDefault). These are prerequisites for fetch's body model. Usual rules: BCL only, net8+, opt-in, default engine unchanged.slicewith negative-index clamping;text()/arrayBuffer()/bytes()return real (already-resolved) promises.endings: "native"is accepted but behaves as"transparent"— honouring it would make a blob's bytes (and any hash or request body over them) depend on the host OS; unknown enum values still throwTypeErrorper WebIDL.stream()is absent (not throwing) until the streams campaign (Web API campaign: Streams and fetch body completion #3082).name,lastModified— defaulting from the engine'sITimeSystemrather thanDateTime.UtcNow, so it agrees withDate.now()and is deterministic under a host-installed clock.File;append/setoverload resolution on the value with three-argument string forms aTypeError(matches Chrome; resolution runs before argument conversion, pinned); a bareBlobvalue is wrapped into aFilenamed"blob"per create-an-entry;setreplaces in place; full iteration surface (entries/keys/values/@@iterator/forEach). The constructor takes no arguments here — a non-undefined argument is aTypeError, per the WinterTC caveat for runtimes without HTML forms. Multipart serialization deliberately lands with fetch, not here.Two defects were caught by writing the failing test first (quoted pre-fix in the test comments):
new File(undefined, 'a')silently building an empty file, and the WebIDLlong longwrap foldinglastModified: -1to0.143 WebApi tests run on net10 (the net472 leg compiles none of this, proving the gate). Verified: all-TFM build, both suites × both frameworks × both host-contract-verification configurations.
🤖 Generated with Claude Code