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
The TemplateStringsArray we emit for tagged templates (as well as its raw property) should be frozen when we emit to --target ES5, to match the ES2015 specification. Without this change, developers could run into issues with a spec-compliant String.dedent polyfill. This was first reported here: tc39/proposal-string-dedent#75 (comment)
Unrelated but I really don’t like that the proposal wants to strip blank lines completely. That feels like more than what a function called dedent should be doing.
@fatcerberus You should open an issue on that repo there if you want to discuss it; this thread isn't the right place. (Though I think you may have misread the proposal.)
Yes, I know this isn't the right place to discuss it. That's why I said "unrelated". It was more idle musing than anything; I don't actually have a strong enough opinion one way or the other to bother formally arguing the point.
tbh I'm more curious exactly what this function is doing under the hood that it apparently requires a frozen TemplateStringsArray.
Bug Report
The
TemplateStringsArray
we emit for tagged templates (as well as itsraw
property) should be frozen when we emit to--target ES5
, to match the ES2015 specification. Without this change, developers could run into issues with a spec-compliantString.dedent
polyfill. This was first reported here: tc39/proposal-string-dedent#75 (comment)🔎 Search Terms
tagged template array frozen TemplateStringsArray
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Neither the
TemplateStringsArray
nor itsraw
property are frozen.🙂 Expected behavior
Both the
TemplateStringsArray
and itsraw
property should be frozen.The text was updated successfully, but these errors were encountered: