closes #650: URL pathname/search/hash setters (v0.5.794) - #663
Merged
Conversation
The last remaining #650 sub-issue. Pre-fix u.pathname = "/x" etc. fell through to generic PropertySet — the named field updated but href stayed stale (the issue's exact symptom). Fix: - HIR variants UrlSetPathname / UrlSetSearch / UrlSetHash - HIR detection in expr_assign.rs: route URL-typed receiver + pathname/search/hash prop assignments to the new variants - Codegen unboxes URL pointer + StringHeader value, calls runtime - Runtime helpers update field + normalize leading sigil + clear on empty + call new rebuild_url_href() that reads all components and recomposes href matching create_url_object - Search setter additionally re-parses query into the stored URLSearchParams object Closes #650 (all 7 sub-issues now resolved across 0.5.770 / 0.5.789 / 0.5.791 / 0.5.792 / 0.5.793 / 0.5.794). Sanity: 10 representative tests byte-identical to Node.
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.
Summary
Closes #650 — last remaining sub-issue: URL
pathname/search/hashsetters.Pre-fix
u.pathname = "/x"etc. fell through to genericPropertySet— the named field updated buthrefstayed stale (the issue's exact symptom:u2.hrefreads the original afteru2.pathname = "/changed").Fix:
Expr::UrlSetPathname/_Search/_Hash({ url, value }shape)expr_assign.rs: URL-typed receiver + pathname/search/hash prop assignments → URL setter variantsrebuild_url_href()that reads all components and recomposes href matchingcreate_url_object's logic#650 was tracked across 7 sub-issues; all now resolved across v0.5.770 / v0.5.789 / v0.5.791 / v0.5.792 / v0.5.793 / v0.5.794.
Out of scope
The pre-existing chained-access limitation
url.searchParams.get(key)(where the receiver is a PropertyGet, not a typed local) — the URLSearchParams-method dispatch only fires on typed locals. Left as a separate followup; not part of #650's setter symptoms.Test plan
test_issue_650_url_static.tscovers each setter + normalization + empty-clear — byte-identical to Node