fix: reject Symbols in template substitutions - #10995
proggeramlug wants to merge 2 commits into
Conversation
|
Warning Review limit reachedNext included review available in 2 minutes. View limit detailsLimit details: You’ve used all 8 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (43)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Held from merge train 257 (#11039) by the file-size cap: on current main this takes Split it into topical sub-modules — extract a function group into a sibling file and re-export with explicit named |
|
Assembled this into train 261 and had to pull it back out — it now trips a required
Your own CI passed that gate because main was shorter when your branch was cut. Dropping just these two commits from the train put it back to I have a separate PR going up that splits Everything else here is green: all 6 gap shards, cargo-test, warnings, e2e-scoped, gc-stress. |
|
Landed on Cherry-picked from this PR's head Nothing needed from you. Thanks. |
Fixes #10609.
Template substitutions now use an implicit string conversion that rejects Symbols. The native path carries that check through an object's
Symbol.toPrimitiveandtoStringresults. The JS and WASM backends emit template interpolation with the same behavior. The concat optimization keeps the check when a declarednumbercontains a Symbol at runtime. ExplicitString(symbol)andsymbol.toString()retain their existing behavior.Added
test_gap_10609_template_symbol.tsfor direct, multi-part, declared-number, and object-returned Symbols, plus the explicit conversion controls.Validation:
cargo check --profile perry-dev -p perry-hir -p perry-codegen -p perry-codegen-js -p perry-codegen-wasm -p perry-runtimecargo build --profile perry-dev -p perry -p perry-runtime-static -p perry-stdlib-staticPERRY_SKIP_BUILD=1 ... ./run_parity_tests.sh --filter test_gap_10609_template_symbol— 1/1 passcargo fmt --all --check,scripts/check_file_size.sh,node --check crates/perry-codegen-wasm/src/wasm_runtime.js