Skip to content

fix(runtime): String.raw usable as a first-class function value - #4636

Merged
proggeramlug merged 1 commit into
mainfrom
fix-string-raw-static
Jun 5, 2026
Merged

fix(runtime): String.raw usable as a first-class function value#4636
proggeramlug merged 1 commit into
mainfrom
fix-string-raw-static

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Completes the static-function-values series (Date #4622, Array #4626, Number #4631, String.fromCharCode/fromCodePoint #4634).

Reify String.raw as a real function value: a thunk taking the template/cooked object as a fixed param plus a rest of substitutions (call-arity 1, spec .length 1), forwarding to js_string_raw. Add raw to the String reroute-undo exception so value reads hit the reified receiver.

Byte-identical to node: String.raw.name === 'raw' / .length === 1, value-calls (const r = String.raw; r({raw:[…]}, …)) and tagged-template calls (String.raw\x${10}y`) work. Fixes test262 built-ins/String/raw/{name,length}`; closes the String portion of #4627.

Completes the static-function-values series (Date #4622, Array #4626, Number
#4631, String.fromCharCode/fromCodePoint #4634). Reify String.raw as a real
function value: a thunk taking the template/cooked object as a fixed param plus
a rest of substitutions (call-arity 1, spec .length 1), forwarding to
js_string_raw. Add 'raw' to the String reroute-undo exception so value reads hit
the reified receiver.

Byte-identical to node: String.raw.name==='raw'/.length===1, value-calls
(const r=String.raw; r({raw:[...]}, ...)) and tagged-template calls
(String.raw`x${10}y`) work. Fixes test262 String/raw/{name,length}; closes the
String portion of #4627.
@proggeramlug
proggeramlug merged commit 8c674d3 into main Jun 5, 2026
13 checks passed
@proggeramlug
proggeramlug deleted the fix-string-raw-static branch June 5, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant