You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perry handles String.raw\...`as a tagged-template fast path, but there does not appear to be an implementation for the callable static method formString.raw(callSite, ...substitutions)`. Node supports both forms.
This matters for libraries that call String.raw as a normal function with an array-like { raw } object rather than using template literal syntax.
Node behavior
Local Node v25.9.0 probe:
"aXb""aXbYc""aXb"""""TypeError:Cannot convert undefined or null to objectTypeError:Cannot convert undefined or null to object
String.raw reads callSite.raw as an array-like object, interleaves substitutions between raw segments, returns "" for zero raw segments, and throws TypeError for nullish callSite / raw.
Perry evidence
crates/perry-hir/src/lower/lower_expr.rs special-cases tagged template literals whose tag is exactly String.raw, directly concatenating SWC raw quasi text and interpolated expressions.
test-files/test_gap_string_methods.ts covers String.raw\...`` tagged template usage, including interpolation and an empty tagged template.
crates/perry-hir/src/analysis/builtins.rs and crates/perry-hir/src/lower/array_fold.rs list String.raw as a known String static, but source search found no Expr::StringRaw, js_string_raw, runtime helper, or module_static lowering branch for ordinary String.raw(...) calls.
crates/perry-hir/src/lower/expr_call/module_static.rs has explicit static branches for String.fromCharCode and String.fromCodePoint, but no corresponding branch for String.raw.
Duplicate check
Searched issues and PRs for:
String.raw callSite
String.raw
PR search for String.raw
No focused tracker showed up.
Expected fix shape
Add callable String.raw(callSite, ...substitutions) support using Node/ECMAScript array-like raw semantics.
Preserve the existing tagged-template fast path where it is semantically equivalent.
Throw TypeError for nullish call sites or nullish callSite.raw.
Add regression coverage for direct-call arrays, array-like raw objects, extra/missing substitutions, zero-length raw, and nullish error cases.
Activity